Reputation: 1244
I have a BIG problem... a marketing 'expert' sent out a campaign with the wrong link. Instead of linking to a landing page, it links to our 'About Us' page.
I'm trying to figure out how to redirect the link using .htaccess. I can't just redirect all traffic to that page, or our about us page becomes useless. The url contains GET parameters that I figured I could use like this:
302 Redirect ^www\.mysite\.com\/wrong\-page\/?get_param=sandwich&get_bread=bolillo-roll ^www\.mysite\.com\/correct\-page\/?get_param=sandwich&get_bread=bolillo-roll
This has no effect. Maybe a small syntax error I'm missing? Or perhaps the parameters are messing it up? Any suggestions are appreciated.
Upvotes: 2
Views: 274
Reputation: 785176
You can't match query string like that. Use mod_rewrite
rules instead:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^get_param=sandwich&get_bread=bolillo-roll [NC]
RewriteRule ^wrong-page/?$ /correct-page [L,NC,R=302]
QUERY_STRING
will be automatically carried over to new URL.
Upvotes: 1