Jump to content

How to redirect search results to a specific page?


@diegofrancesco

Recommended Posts

Hello,

I need to redirect the URL of a single search to a specific page, with htaccess. I have read many threads about redirect with parameters but no tested solution works in my case.

old url /research?controller=search&s=brand
new url https://www.domainname.com/5_c-brand?

How should I set up the redirect to make it effective?

Thanks in advance

 

One of the various tests I did was this:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^controller=search&s=brand$
RewriteRule ^ https://www.domainname.com/5_c-brand? [R=301,L]

or this

RewriteEngine On
RewriteCond %{QUERY_STRING} ^controller=search&s=brand 
RewriteRule ^research https://www.domainname.com/5_c-brand? [NC,R,L]

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...