Royer Royer - 1 year ago 71
Apache Configuration Question

How to create a 301 redirect for new product URL in htaccess

I have the following problem.

My website has changed the cms and the product URLS are different. They used to look like this:

The new one however looks like this:

How can I create a redirect for all products that look like that using .htaccess?

Thank you

Answer Source

You can use the following rule :

RewriteEngine on

RewriteCond %{THE_REQUEST} /old-link/\?a1=([^&]+)&b2=([^&]+)&c3=([^&]+)\sHTTP [NC]
RewriteRule ^ /new-link/%1-%2-%3? [L,R]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download