Plus sign ( + ) in a rewrite rule (.HTACCESS on Linux Server) (SOLVED)

Posted by ienabellamy on Server Fault See other posts from Server Fault or by ienabellamy
Published on 2012-11-15T15:38:04Z Indexed on 2012/11/15 17:03 UTC
Read the original article Hit count: 187

Filed under:

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]

© Server Fault or respective owner

Related posts about rewrite