.htaccess RewriteRule导致内部服务器错误

时间:2015-11-06 17:41:48

标签: php apache .htaccess mod-rewrite internal-server-error

在我的网站上,我想访问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/indexindex.php已投放。

到目前为止,非常好。

但现在,当我说mysite.com/index/a时,我收到内部服务器错误。这是为什么?这是在我搬到新的网络主机之后。

我不熟悉mod_rewrite;我只是从Stack Overflow中复制了上面的某些行。他们可能出了什么问题?

0 个答案:

没有答案
相关问题