在我的网站上,我想访问PHP资源而无需提供.php
扩展名,因此在.htaccess
中,我说
RewriteEngine on
# If applicable, append ‘.php’
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]
这很有效。我说mysite.com/index
,index.php
已投放。
到目前为止,非常好。
但现在,当我说mysite.com/index/a
时,我收到内部服务器错误。这是为什么?这是在我搬到新的网络主机之后。
我不熟悉mod_rewrite;我只是从Stack Overflow中复制了上面的某些行。他们可能出了什么问题?