Reputation: 473
I have a redirect rule set up as below
Redirect /Products.aspx?Category_ID=15 https://www.trainerbubble.com/free-training-resources/
However, when going to the address it attaches itself to an existing page /training-products and results in this
https://www.trainerbubble.com/training-products/?Category_ID=15
How can I force the original redirect and make it stop thinking its part of the /training-products page?
Upvotes: 1
Views: 12
Reputation: 784938
You cannot match query string in Redirect
directive. Use mod_rewrite
rules instead:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^Category_ID=15$ [NC]
RewriteRule ^Products\.aspx$ https://www.trainerbubble.com/free-training-resources/? [L,NC,R=301]
?
at the end of target URL is to strip off previous query string.
Upvotes: 1