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 FTP access to my ASP.NET Websapce (IIS 7) and I route subdomains with a Web.config in the web root folder. She looks like this:

<?xml version="1.0" encoding="UTF-8"?>
                <rule name="route www and emtpy requests" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern="^(www.)?" />
                        <add input="{PATH_INFO}" pattern="^/www/" negate="true" />
                    <action type="Rewrite" url="\www\{R:0}" />
                <rule name="route to blog" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern="^$" />
                        <add input="{PATH_INFO}" pattern="^/blog/" negate="true" />
                    <action type="Rewrite" url="\blog\{R:0}" />

As you can see i have two folders in my root directory: "www" and "blog". When i now enter "" everythink is working fine, but when i click a link i will go to ""

What can I do to prevent this behavior ?

share|improve this question

Its because your redirecting to, you need to redirect to the FQDN.(foo.con/blog instead.

share|improve this answer
I'm not realy understand what you mean, could you please make a example rule? – NKnusperer Feb 14 '11 at 17:19
redirect blog.(mydomain).com to – Jacob Feb 14 '11 at 17:21
But than its not a subdomain anymore? – NKnusperer Feb 14 '11 at 17:22
your users can access it via subdooain – Jacob Feb 14 '11 at 17:27

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.