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 need to redirect an entire microsite ( to relevant pages on my main site (

My main site has a custom 301 module (built into the 404 page) which checks unfound paths against a list of paths where we've moved a page. So if I simply redirect the entire of my microsite at domain level I can handle all the paths from it in the 301 module.

But: I want the index page for my microsite to map to, instead of to the domain itself.

So > Domain redirect > > 404 > 301 Module >

but > Domain Redirect >

I need > Domain Redirect >

Can this be done with URL rewrite, and if so, what would the regex look like that would rewrite a domain for all URLs with a domain/path structure but add a path if the URL to redirect contained ONLY the domain?

share|improve this question
up vote 1 down vote accepted

Yes, you can use the URLRewrite module.

<match url=".*"/>
        <add input="{HTTP_HOST}" pattern="" />
<action type="Redirect" url="{R:1}" 
share|improve this answer

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.