0
我有這段代碼,將domain.com/Birthdays/birthdays.php?n=Something轉換爲domain.com/Birthdays/Something,併爲其他頁面取下.php和.html文件:.htaccess代碼給出的錯誤500
RewriteEngine on
RewriteRule ^Birthday/(\w+)$ /Birthdays/birthdays.php?n=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
問題是當我補充一點:
RewriteEngine on
RewriteRule ^Birthdays/(.*)$ [L]
RewriteRule ^Birthday/(\w+)$ /Birthdays/birthdays.php?n=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
它給了我一個錯誤(500),但如果我改變對(\ w +),它的工作原理(*)。但我不想那樣。