Hi,
I am trying to get a pattern to satisfy following redirect scenarios.
I would need to Redirect the following URLs
'http://www.mysite.com/test.html?id=100
'http://www.mysite.com/test.html?test1=a00&id=100
'http://www.mysite.com/test.html?activity_id=100
'http://www.mysite.com/test.html?test1=a00&activity_id=100
and I would not redirect the following
'http://www.mysite.com/test.html
'http://www.mysite.com/test.html?test1=a00&xx_id=100&test2=200
i.e, the URL with parameter 'id=<value>' should redirect. But the URL with '<anything>id=<value>' should not. I am trying to find a RegEx that can do an exact match of 'id=<value>' anywhere in the URL as a Query Param.
Here is what I am trying to do.
RewriteCond %{HTTP_HOST} mysite\.com|www.\mysite\.com
RewriteCond %{QUERY_STRING} activity_id=|^id=
RewriteRule (.*) 'http://google.com?
This works fine for
'http://www.mysite.com/test.html?id=100
But not for
'http://www.mysite.com/test.html?test1=a00&id=100
Because, 'id=<value>' is not the first parameter in the URL.
Thanks
Abhilash