I need to redirect a URL that has ?ABC at the end but the regex in my REDIRECTMATCH directive does not see the ?ABC.
I have tried many including the following:
RedirectMatch (.*)\?ABC$ $1?XYZ
RedirectMatch (.*)ABC$ $1?XYZ
RedirectMatch (.*)?ABC$ $1?XYZ
But no REDIRECTION occurs.
1. I cannot use REWRITE as Frontpage Extensions are affected.
2. $1?XYZ is not important in this example.
3. Though a newbie at regexs my experiments work as intended UNTIL I add ?anything at the end of a URL.
4. The object of the exercise is to know when a URL has certain 'tracking' information on the end.
5. My URL in question is on many many sites throughout the web so I cannot change it.
I'll give you an example that works WITHOUT the ?ABC.
My intention is to redirect
RedirectMatch (.*)PageOne.htm$ $1PageTwo.htm
in the .htaccess file within the Test directory.
This works fine, 100%, I just did it now.
However if I want to redirect
RedirectMatch (.*)PageOne.htm?ABC$ $1PageTwo?XYZ.htm
NO redirection takes place as the PageOne.htm?ABC
is not matched at the end of the string.
No matter how I fiddle with (.*)PageOne.htm?ABC$
I cannot get a match.
As I said originally this is very important for me to resolve as I have an important URL in cyberspace that I urgently need to redirect.