How to redirect URL with wilcard parameters using htaccess?

123 views Asked by At

I'm using Newsletter plugin for WordPress. I've sent a newsletter out to my mailing list with a link but the link is not working. It's creating a url with /?nltr=MTs0NjtodHRwOi8vd3d3LmhlYWx0aHlmb29kc29sdXRpb25zLmNvLnVrL3JlY2lwZS1zdXJ2ZXkvOzsxYWE2NTRhYmQyNjhkZDk4OGZkN2NjNGRiMjhmZjE4MQ%3D%3Dand returing a 404 and not loading the page. I've logged a support ticket.

I thought I could maybe use htaccess to do a wilcard redirect something like:

RedirectMatch 301 ^/?nltr=(.*)  /correct-page/ 

But this doesn't work.

Any suggestions please?

1

There are 1 answers

0
Hobo On

You need to match on %{QUERY_STRING}. Take a look at this answer.