我希望apache使用查询字符串将所有请求重定向到文件到相同的url。
从此: /images/all/1.jpg
对此: /images/all/1.jpg?ver=1
我正尝试这样,但是却无能为力:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^$/
RewriteRule ^/images/all/1\.jpg$ /images/all/1.jpg?ver=1 [R=302,L]
答案 0 :(得分:0)
您也许可以使用此规则:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^images/all/1\.jpg$ %{REQUEST_URI}?ver=1 [R=302,NE,L]