我一直在使用以下脚本进行友好的网址,它在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]
答案 0 :(得分:0)
RewriteEngine On
需要独立。它不是Options
的论据。
答案 1 :(得分:-1)
对于Apache2.2
在 httpd.conf 文件中,您必须设置 AllowOverride All