Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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]
share|improve this question
    
Please describe what do you want to do instead something that does not work. –  cstamas Nov 15 '12 at 15:55
    
yea you're right, i'll edit main topic ;) –  ienabellamy Nov 15 '12 at 15:55

1 Answer 1

            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.

share|improve this answer
    
...why, exactly ? How is it different from his RewriteCond/Rule combination ? –  adaptr Nov 15 '12 at 16:08
    
it doesn't works :-/ doesn't give an error, simply remain same url –  ienabellamy Nov 15 '12 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 '12 at 22:21

Your Answer

 
discard

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.