I’m trying to transform this URL:
http://localhost/?q=foo&s=search
on this:
http://localhost/?q=+foo&s=search (i add a plus sign before the user query)
I tried with:
RewriteCond %{QUERY_STRING} ^q=(.*)$ [NC]
RewriteRule ^(.*)$ /?q=\+%1 [R=301,L,NE]
But this generates:
http://localhost/?q=+++++++++++++++++++++foo
Any advice on how to add the plus sign before the query?
Two quick/easy options:
+in the backend (PHP:$query = '+' . $_GET['q'];)Add a param indicating the redirect and avoiding the redirect.