To test the local dev, I need to catch all requests from www.somedomain.com/XXX (where X is the path) and send them to localhost/somevdir/XXX .
I added this to my HOSTS file (c: \ windows \ system32 \ drivers \ etc):
127.0.0.1 www.mydomain.com
Then in IIS8 (Windows 8) I added a binding to my "Default Web Site" for the site www.mydomain.com. This works, now I can view www.mydomain.com/test.html and see the html test page. My virtual directory is inside the default website. Then I add the URL rewrite URL to the website for the last bit:
<rewrite> <rules> <rule name="mydomain.com" stopProcessing="true"> <match url="^www.mydomain.com/(.*)" /> <action type="Rewrite" url="localhost/MyVDir/{R:1}" logRewrittenUrl="true" /> </rule> </rules> </rewrite>
But - it does not work. I get 404, so it looks like a match never happens. I tried redirecting and rewriting, and I tried without ^ in the regex and several other regex tags. Can someone explain what I did wrong?
source share