I have my website hosted on discountasp as example - foo.com . The website is under the root directory. So I can easily go with foo.com/fooapp I have a domain name registered www.bar.com and I already used the domain pointer to add the domain. Now, whenever I type www.bar.com, I want it to display foo.com/fooapp without changing the addressbar URL. I am new to URL Rewrite. Please help. I've tried to use these recommended websites http://weblogs.asp.net/owscott/iis-url-rewrite-hosting-multiple-domains-under-one-site http://blog.discountasp.net/url-rewrite-2-0-for-iis-7-is-here/ Thanks in advance
Yes, but I want the url to still say www.bar.com instead of foo.com/fooapp I have a domain pointer www.bar.com I already pointed nameservers at www.bar.com to discountasp.net
This should do it for you <rewrite> <rules> <rule name="bar.com" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^(www.)?bar.com" /> <add input="{PATH_INFO}" pattern="^/fooapp/" negate="true" /> </conditions> <action type="Redirect" url="\fooapp\{R:0}" /> </rule> </rules> </rewrite>