1

I have this URL rewrite rule

RewriteRule ^(send-your-request.*)$ / [NC,L,QSA,R=301]

it should basically just remove "/send-your-request" from the the URL (i.e. rewrite it with query string parameters from the domain i.e.

http://example.com/send-your-request/?a_aid=rocketnews24&pname=just%20a%20test

is rewritten to:

http://example.com/?a_aid=rocketnews24&pname=just%20a%20test

In that cases it works, but if I add the last parameter, it stops working

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

Can anyone tell me a better rewrite rule that can handle all the query string parameters?

EDIT here are my other rules, but I have "L" on the first one, so it should stop processing right?

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]
2
  • 1
    Remove the QSA switch from your rules - as I understand the logic, you don't need to process query string. The query string appended in the regexp is the cause of your problem Nov 9, 2012 at 19:45
  • @KamilŠrot I took the qsa off, but the behavior is same. If the final parameter is plink=123 it works (redirects), but if the final param is a url, it will not redirect (404 on my site)... :(
    – ChatGPT
    Nov 12, 2012 at 7:07

1 Answer 1

0

Solved: it was a Mod_security rule designed to protect against injection. Working to get it disabled now.

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}'"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .