view raw
Vyshnavi Samudrala Vyshnavi Samudrala - 8 months ago 99
Apache Configuration Question

Redirect URLs with parameters

I have URLs like

I need to add parameters to the end of the URL like

How do I make a rewrite rule in
file to get that?


You can use this redirect rule:

RewriteEngine On

RewriteCond %{QUERY_STRING} !(^|&)sort_value=distance(&|$) [NC]
RewriteRule ^city/some-url-structure/?$ %{REQUEST_URI}?sort_value=distance [L,NC,QSA,NE,R=301]