I have two domains: www.abc.com which is the main domain linked to my discountasp hosting account www.xyz.com that is a domain pointer to my discountasp hosting account The content of www.abc.com is under a folder called abc and the content of www.xyz.com is under a folder called xyz. I want people to use and see in the browser url bar only www.xyz.com/Default.aspx and not www.xyz.com/xyz/Default.aspx if possibile. I have the following rewriting rule in the root directory webconfig Code: <configuration> <system.webServer> <rewrite> <rules> <rule name="Rewrite to folder1" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="^www.xyz.com$" /> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> </conditions> <action type="Rewrite" url="xyz/{R:1}" /> </rule> <rule name="Rewrite to folder2" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="^www.abc.com$" /> </conditions> <action type="Rewrite" url="abc/{R:1}" /> </rule> </rules> </rewrite> </system.webServer> </configuration> But when I browse for www.xyz.com, although he's working fine, the url bar shows www.xyz.com/xyz/ How can I avoid that and have only www.xyz.com/ as my url? Thanks in advance for any response
Anyone? I have tried to open a ticket, but unfortunately this kind of issues are not supported. Thanks in advance for any advice.
Hey redarko, I've been thru all the motions and having received zero help from the DASP staff here, I made contact with a Microsoft MVP familiar with UrlRewrite on IIS7. The situation you describe is unavoidable. Unfortunately the UrlRewrite is not a comprehensive solution for dealing with subdomains to subdirectory. I wish this had been made clearer before I signed up here, all over the forums as you've noticed it sounds like this is a workable solution. Please see my thread here: http://community.discountasp.net/showthread.php?t=9688 Hope this helps.
Hi, Please don't blame the DASP Staff. ;-) You should use the IIS7 resources for this, Forums, Videos, Blogs, etc. http://www.iis.net/ Honestly once I catchup a bit I'll create DASP Webcasts for this. All the best, Mark Note: Just spotted this excellent article: http://weblogs.asp.net/owscott/archive/2009/11/27/iis-url-rewrite-rewriting-non-www-to-www.aspx
It's not a matter of blame wisemx, it's just fact. I didn't get the help I needed here so I went elsewhere. I went out on my own, spent hours only to find out that there are inherent shortcomings in UrlRewrite when trying to emulate the behavior of host headers, and wanted to save this guy the time. It's no big deal, hopefully my experiences will help him.
I don't know about url rewriting but can't you load page specific content based on the the Request url. What url does Page.Request.Url.ToString(); give you? If it gives you www.xyz.com you can load content specific to that url. Your pages would just have to be dynamically created
I don't understand exactly what do you mean, but I still want to use url rewriting for SEO purpose. After I have tried many things, included the links that wisemx has suggested me, I think that this is not possible to do in discountasp.net as today. Unfortunately you must keep the folder name in your url.