The site was initially hosted on a Windows Server and it was created using .asp programming language. Now it has been moved to a linux server running cPanel/WHM and the new site is built using WordPress and WooCoomerce (the site is an online shop).
I need to do some .htacess redirects from old .asp urls to the new links
Example:
old URL: http://website.com.au/products.asp?cat=110
new URL: http://www.website.com.au/product-category/pearls/
What I did try is:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
Redirect 301 /products.asp?cat=110 http://www.website.com.au/product-category/pearls/
For some reason the redirect is not working and I get a 404 page not found error.
Any help would be appreciated!
You can not match against query strings in a Redirect Directive, you need to match against query strings using a rewriteCond, try:
An empty question mark at the end of the target url is important if you don’t want the old query strings to be appended to the target url.