Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

is rewritten to:

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

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
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]
share|improve this question
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 – Kamil Šrot Nov 9 '12 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)... :( – Max Hodges Nov 12 '12 at 7:07
up vote 0 down vote accepted

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:' UNSUPPORTED DELAYED Rules: Uniencoded possible Remote File Injection attempt in URI (AE)',logdata:'%{MATCHED_VAR}'"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.