我有这个 URL 重写规则
RewriteRule ^(send-your-request.*)$ / [NC,L,QSA,R=301]
它基本上应该只是从 URL 中删除“/send-your-request”(即用域中的查询字符串参数重写它,即
http://example.com/send-your-request/?a_aid=rocketnews24&pname=just%20a%20test
被重写为:
http://example.com/?a_aid=rocketnews24&pname=just%20a%20test
在那种情况下它可以工作,但是如果我添加最后一个参数,它就会停止工作
http://example.com/send-your-request/?a_aid=rocketnews24&pname=just%20a%20test&plink=http%3A%2F%2Fradio-eva.jp%2Fshop%2Fproducts%2Fdetail.php%3Fproduct_id%3D82
谁能告诉我一个可以处理所有查询字符串参数的更好的重写规则?
编辑 这里是我的其他规则,但我在第一个上有“L”,所以它应该停止处理吧?
RewriteRule ^(send-your-request.*)$ / [NC,QSA,R=301,L]
Redirect 301 /products http://whiterabbitexpress.com/
RewriteRule ^index\.php$ - [L]
RewriteCond %{QUERY_STRING} ^(.*)q=(.*)$
RewriteRule ^(.*)$ $1?%1s=%2 [L,R=301]
RewriteRule ^catalogsearch/result/?$ / [NC,QSA,L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
已解决:这是一个旨在防止注入的 Mod_security 规则。现在正在努力将其禁用。
SecRule REQUEST_URI "=(?:ogg|gopher|data|php|zlib|(?:ht|f)tps?)://" \ "capture,id:340165,t:none,t:urlDecodeUni,t:replaceNulls ,t:compressWhiteSpace,t:lowercase,rev:275,severity:2,msg:'Atomicorp.com UNSUPPORTED DELAYED Rules: Uniencoded possible Remote File Injection attempt in URI (AE)',logdata:'%{MATCHED_VAR}'"