Reputation: 750
As part of a migration I need to redirect sections of a site.
The below RedirectMatch is working, but the query string is being carried across. I have tried using a "?" in various ways to remove the original query string, but have been unable to get it to work.
Current RedirectMatch:
RedirectMatch 301 ^/store/match.*$ http://shop.domain.com/new-directory/
The above RedirectMatch turns this:
domain.com/store/match-something-something-c-536.html?osCsid=123456…
Into this:
shop.domain.com/new-directory/?cPath=536&osCsid=123456...
But I want:
shop.domain.com/new-directory/
Upvotes: 1
Views: 18
Reputation: 786091
You need to use mod_rewrite
for this:
RewriteEngine On
RewriteRule ^store/match http://shop.domain.com/new-directory/? [R=301,L,NC]
Upvotes: 1