Hey guys,
Got myself stuck on a little htaccess thing here.
I am looking to rewrite a dynamic parameter to static url but it appears in multiple locations, due to a #*$!ty CMS.
i.e.
www.example.com/blue-product.html?foo=bar
www.example.com/red-product.html?foo=bar
www.example.com/product-list.html?foo=bar
How do I write a redirect to catch the potentially hundreds of pages this could appear on, I tried using my usual redirect code with a wild card but this didn't fly.
The bigger problem I am facing? I need to keep the page on the product .html url ie. blue-product.html so ideally I cannot rewrite the urls to blue-product/foo/bar/ because of some external factors. I can get away with a different url as long as it ends with blue-product.html however so the target url may be something like;
http://www.example.com/foo/bar/blue-product.html
Or anything similar tbh I am open to suggestions.