Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a site running on IIS 7.5 that does an automatic redirect from '' to ''

On the site, there is a lot of traffic to an old URL that I want to redirect to the front page, index.aspx: ''

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 ''

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 '' to '', but if I add the query string parameters, it still redirects to ''

Isn't there a way to catch all requests to the cgi file, including query string parameters?

share|improve this question

So, I managed to get it working in the following way:

1) Add the subdirectory /foo/bar to the application in IIS
2) Add the file index.cgi in the subdirectory
3) Create the following webconfig in the subdirectory:

<?xml version="1.0" encoding="UTF-8"?>
    <httpRedirect enabled="true"  exactDestination="true" httpResponseStatus="Permanent">
      <add wildcard="*.cgi*" destination="" />

That catches all requests to index.cgi, but that works for me. I could probably have gotten it to work with just the URL I specified over, but it's not needed.

share|improve this answer
You could use URL Rewrite module and do all this without creating folders/index.cgi -- – LazyOne Jul 2 '12 at 10:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.