Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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've tried to find a solution to this and found some guides out there but none seem to work.

I have the following URL -

However there are some other sites which link to my old hosted site and point to My issue here is trying to remove the 'nw' directory from the URL's.

I have setup the following URL Rewrite in IIS but it does not seem to do anything,

<?xml version="1.0" encoding="UTF-8"?>
                <rule name="Redirect all to root folder" enabled="true" stopProcessing="true">
                    <match url="^nw$|^/nw/(.*)$" />
                    <action type="Redirect" url="nw/{R:1}" />
                <rule name="RewriteToFile">
                    <match url="^(?!nw/)(.*)" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    <action type="Rewrite" url="/{R:1}" />


Any insight would be appreciated.

share|improve this question

migrated from Oct 6 '12 at 6:39

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

Was able to resolve this issues with the following

            <rule name="RemoveDirectory">
                <match url="nw/(.*)" />
                <action type="Rewrite" url="/{R:1}" />
                    <add input="{HTTP_HOST}" pattern="^$" />
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.