Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 - http://www.mysite.com/aboutus.html

However there are some other sites which link to my old hosted site and point to http://www.mysite.com/nw/aboutus.html. 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 stackoverflow.com Oct 6 '12 at 6:39

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

1 Answer 1

up vote 0 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="^www.mysite.com$" />
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.