Old URL - test.com/our-stores/nearest/?view=locations&storename=New%20York%20City
New URL - test.com/our-stores/New-York-City
Currently I've got this to do the redirection ....
RewriteEngine on
RewriteCond %{QUERY_STRING} ^view=([^&]+)&storename=([^&]+)
RewriteRule ^our-stores/nearest/$ http://test.com/our-stores/%2? [R=301,L]
Which goes to...
test.com/our-stores/New%20York%20City
I've tried a number of ways to remove the %20's (eg. generic %20 replace) but it doesn't work on parameters like the old URL...
RewriteCond %{THE_REQUEST} (\s|%20)
RewriteRule ^([^\s%20]+)(?:\s|%20)+([^\s%20]+)((?:\s|%20)+.*)$ $1-$2$3 [N,DPI]
RewriteRule ^([^\s%20]+)(?:\s|%20)+(.*)$ /$1-$2 [L,R=301,DPI]
Any ideas? I feel i've tried 100s of combinations :(