0

i've this snippet, but it doesn't works. Obviously is that plus sign + tha must be escape ?

RewriteCond %{QUERY_STRING} ^orderby=position&controller=search&orderway=desc&search_query=t+max$
RewriteRule ^it/cerca$ http://www.wrs.sm/it/cerca?orderby=position&controller=search&orderway=desc&search_query=tmax? [R=301,L]

i want to redirect this url

http://www.wrs.sm/it/cerca?orderby=position&controller=search&orderway=desc&search_query=t+max

to this

http://www.wrs.sm/it/cerca?orderby=position&controller=search&orderway=desc&search_query=tmax

Thanks ;)

I found the solution, the correct rules are:

RewriteCond %{QUERY_STRING} ^orderby=position&controller=search&orderway=desc&search_query=t\+max$
RewriteRule ^it/cerca$ http://www.wrs.sm/it/cerca?orderby=position&controller=search&orderway=desc&search_query=tmax [R=301,L]
2
  • Please describe what do you want to do instead something that does not work.
    – cstamas
    Nov 15, 2012 at 15:55
  • yea you're right, i'll edit main topic ;) Nov 15, 2012 at 15:55

1 Answer 1

0
            RewriteCond %{REQUEST_URI} ^/it/cerca$
            RewriteCond %{QUERY_STRING} orderby=position&controller=search&orderway=desc&search_query=t+max
            RewriteRule (.*) http://www.wrs.sm/it/cerca?orderby=position&controller=search&orderway=desc&search_query=tmax [R,L]

This may be a good starting point.

3
  • ...why, exactly ? How is it different from his RewriteCond/Rule combination ?
    – adaptr
    Nov 15, 2012 at 16:08
  • it doesn't works :-/ doesn't give an error, simply remain same url Nov 15, 2012 at 16:09
  • @adaptr I copied from a working example from a website operated by me. (Yeah, maybe + needs escaping like the asker said later...)
    – cstamas
    Nov 15, 2012 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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