Reputation: 615
I have the following problem.
My website has changed the CMS and the product URLS are different. They used to look like this:
domain.com/old-link/?a1=291&b2=23&c3=92
The new one however looks like this:
domain.com/new-one/291-23-92
How can I create a redirect for all products that look like that using .htaccess?
Upvotes: 1
Views: 78
Reputation: 41219
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]
Upvotes: 1