Redirecting a single request to another pages, ignoring www subdomain
- by Petter Brodin
I have a site running on IIS 7.5 that does an automatic redirect from 'http://mysite.com/whatever.aspx' to 'http://www.mysite.com/whatever.aspx'
On the site, there is a lot of traffic to an old URL that I want to redirect to the front page, index.aspx: 'http://mysite.com/foo/bar/index.cgi%something=asdf&somethingelse=qwerty'
The problem is that no matter what I try, I can only get the redirect to work with the www subdomain. If I use the URL without www, I just end up at 'http://www.mysite.com/404.aspx'
Any ideas?
Thanks in advance for all help!
Edit3: it seems like the browser caching the redirect response was messing with me, so edit2 is wrong. See my response below.
Edit2: disregard edit1, it doesn't seem like it's working after all.
Edit: here's some further info: using this article I've managed to redirect from 'http://mysite.com/foo/bar/index.cgi' to 'http://www.mysite.com/index.aspx', but if I add the query string parameters, it still redirects to 'http://www.mysite.com/404.aspx'
Isn't there a way to catch all requests to the cgi file, including query string parameters?