Forum Moderators: phranque
I'm trying to redirect:
www.example.com/directory/search_results.php?input=n
to:
www.mydomain.com/search_results.php?input=n
The input (n) can be any number.
I tried:
rewritecond %{REQUEST_URI} /directory/search_results.php$
rewritecond %{query_string} ^input=([0-9]+)
RewriteRule ^.*$ http:/www.mydomain.com/search_results.php?input=%1 [R=301,L]
I've only put one / in the RewriteRule so that the forum doesn't convert it to a link.
I'm sure I'm being stupid here, but it redirects to:
www.mydomain.com/search_results.php?q=n
I could always code the PHP to deal with this, but I should be able to get the .htaccess to work.
Thanks in advance.
Rob
RewriteRule ^directory/search_results\.php$ http://www.example.com/search_results.php [R=301,L]