来自apache 1.3的Mod_ReWrite脚本在2.2中不起作用

时间:2011-04-15 12:54:20

标签: apache mod-rewrite apache-1.3

我一直在使用以下脚本进行友好的网址,它在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]

2 个答案:

答案 0 :(得分:0)

RewriteEngine On需要独立。它不是Options的论据。

答案 1 :(得分:-1)

对于Apache2.2

httpd.conf 文件中,您必须设置 AllowOverride All