SEO友好的Urls 500服务器错误



我的htcaccess文件中有以下内容:

Options +Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php # Remove .php from filename
RewriteRule ^profiles/([^/]+).php profiles.php?id=$1&%{QUERY_STRING} [L] # Pretty url for Profile page
RewriteRule ^crime/([^/]+).php crime.php?id=$1&%{QUERY_STRING} [L] # Pretty url for Crime page
RewriteRule ^edit_account/([^/]+).php edit_account.php?type=$1&%{QUERY_STRING} [L] # Pretty url for Edit Account Page

到目前为止,.php部分将从文件中剥离,但现在,当我尝试使用配置文件页面时,通过以下url:/profiles/1.php或/profiles/1,我得到一个500内部服务器错误。文件里有什么错误吗?

如果您在远程服务器上托管此网站,请询问他们是否阻止了.htaccess。这发生在我身上,服务器管理员在没有通知的情况下停止了.htacccess。

一旦编写了删除扩展的规则,就不需要编写.php

RewriteRule ^profiles/([^/]+) profiles.php?id=$1&%{QUERY_STRING} [L] #without .php

最新更新