Redirecting a single request to another pages, ignoring www subdomain

Posted by Petter Brodin on Server Fault See other posts from Server Fault or by Petter Brodin
Published on 2012-07-02T07:59:01Z Indexed on 2012/07/02 9:17 UTC
Read the original article Hit count: 273

Filed under:
|
|

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?

© Server Fault or respective owner

Related posts about iis7.5

Related posts about redirect