.htaccess文件命令无效

时间:2012-04-02 18:29:41

标签: .htaccess mod-rewrite

我刚刚将此网站发送给我,因为页面未加载,而是显示500错误。我将整个站点迁移到我的localhost并查看了我的日志。它表明它是RewriteCompatability2上的无效命令。我现在正在研究这个问题,但是我会更喜欢这个。特别是因为我从来没有遇到这个问题,或者真的用mod_rewrites处理过多。这是代码:

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.78

RewriteEngine On

RewriteCompatibility2 On

RepeatLimit 200

RewriteBase

#RewriteRule ^products/[^?/]*_(\d+)\.asp /productpage.asp?productID=$1 [QSA]
#RewriteRule ^/categories/(.*)$ /category.php?c=$1  [NC]
#RewriteRule ^/categories/(.*) /category.php?c=$1
#RewriteRule ^/contact(.*) /contact.php
#RewriteRule ^/order(.*) /order.php
#RewriteRule ^/about(.*) /about.php
#RewriteRule ^/privacy(.*) /privacy.php
#RewriteRule ^/search/(.+) /search.php?search=$1

RewriteRule  ^/$ /index.php [PT]
RewriteRule ^/categories/(.*) /category.php?c=$1    [PT]
RewriteRule ^/contact(.*) /contact.php  [PT]
RewriteRule ^/order(.*) /order.php  [PT]
RewriteRule ^/about(.*) /about.php  [PT]
RewriteRule ^/privacy(.*) /privacy.php  [PT]
RewriteRule ^/search/(.+) /search.php?search=$1 [PT]

1 个答案:

答案 0 :(得分:1)

RewriteCompatibility2ISAPI_Rewrite 3 directive。你不应该将它与mod_rewrite一起使用。