1
我在使用wampserver(localhost)开发时为我的网站编写了下面的.htaccess代码。本地主机htaccess代码不能在真正的服务器上工作?
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
# external redirect from /category.php?id=name&phrase=something to /name/something
RewriteCond %{THE_REQUEST} \s/+category\.php\?id=([^&]+)&phrase=([^\s&]+) [NC]
RewriteRule^%1/%2? [R=302,L]
# skip files and directories from rewrites
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule^- [L]
# Cleans up all the article, and wrestler pages
RewriteRule ^/?article/([^/]+)/?$ article.php?id=$1 [L,QSA]
RewriteRule ^/?wrestler/([^/]+)/?$ wrestler.php?id=$1 [L,QSA]
# Removes the .php extension from pages
RewriteCond %{DOCUMENT_ROOT}/$1.php -f [NC]
RewriteRule ^(.+?)/?$ $1.php [L]
# For the redirecion of related topics links on wrestler profile pages
RewriteRule ^([^/]+)/([^/]+)/?$ category.php?id=$1&phrase=$2 [L,QSA]
我刚刚把网站带到真正的服务器上,我得到一个“500内部服务器错误”。
我是否应该从localhost到真正的服务器进行一些更改的代码?请帮帮忙。
可能'FollowSymLinks'不是允许的选项,或者'mod_rewrite'被禁用。您是否尝试过注释“Options + FollowSymLinks”这一行? –
我刚刚尝试过,并没有帮助。我很困惑。 – Vimzy
什么是写入您的Apache错误日志的相关错误? – codnodder