如何解决apache 1.3中的Mod_ReWrite脚本在2.2中不起作用
|| 我一直在使用以下脚本作为友好的URL,并且在Apache 1.3中也可以正常使用。我们刚刚升级到了Apache 2.2.17,它似乎不再起作用。 是否需要调整才能在2.2中工作? mysite.com/products?BRAND=ADIDAS&VENDORCODE=581 (ORIGINAL URL)
mysite.com/products/ADIDAS/581 (FRIENDLY URL)
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*/)?products/([^/]+)/([0-9]+)/?$ $1/products?BRAND=$2&VENDORCODE=$3 [PT,L]
RewriteRule ^(.*/)?products/([^/]+)/([^/]+)/([0-9]+)/?$ $1/products?BRAND=$2&VENDORCODE=$3&offset=$4 [PT,L]
RewriteRule ^(.*/)?DeptItems/([^/]+)/([0-9]+)/?$ $1/DeptItems?BRAND=$2&catCode=$3 [PT,L]
RewriteRule ^(.*/)?DeptItems/([^/]+)/([^/]+)/([0-9]+)/?$ $1/DeptItems?BRAND=$2&catCode=$3&offset=$4 [PT,L]
RewriteRule ^(.*/)?itemdetail/([^/]+)/([^/]+)/?$ $1/itemdetail?BRAND=$2&desc1=$3 [PT,L]
解决方法
RewriteEngine On
必须单独显示。它不是对“ 2”的争论。
,对于Apache2.2
在您的httpd.conf文件中,必须设置AllowOverride All
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。