all i want do is change my querystring from this
result/?q=Southview+Guesthouse to this: result/?q=Southview-Guesthouse.
I've done similar stuff with PHP but never mod_rewrite, has anyone got any ideas? Thanks.
all i want do is change my querystring from this
result/?q=Southview+Guesthouse to this: result/?q=Southview-Guesthouse.
I've done similar stuff with PHP but never mod_rewrite, has anyone got any ideas? Thanks.
Assuming you're only talking about two alphabetic words separated by a plus, this should work (I have tested it and it is working for me):
RewriteCond %{QUERY_STRING} "q=([a-z]+)\+([a-z]+)(&|$)" [NC]
RewriteRule result/$ result/?q=%1-%2 [L,R]
%N
(where N
is 0-9) in a RewriteRule
pattern refers to a backreference in a RewriteCond
.