« Previous Next »
Last post 10-08-2009 3:29 PM by rokrana. 4 replies.
Average Rating Rate It (5)Thank you for the rating!
Page 1 of 1 (5 items)
Sort Posts: Oldest to newest Newest to oldest
I want URL rewriting setting in IIS7 for redirecting subdomain to subfolder.
The scenario is:
http://subdomain1.mysite.com --> http://www.mysite.com/subdomain1 or http://mysite.com/subdomain1http://subdomain2.mysite.com --> http://www.mysite.com/subdomain2 or http://mysite.com/subdomain2
and
http://subdomain1.mysite.com/mypage.aspx --> http://mysite.com/subdomain1/mypage.aspx
Regards,Sandeep
This article explains how to do it: http://learn.iis.net/page.aspx/468/using-global-and-distributed-rewrite-rules/
Dear Ruslany,
I have done the same thing and its now working.But there is a little issue. It also rewrite for www.
Like: http://www.mysite.com to http://mysite.com/www/That mean I am not able to access my main site content.
This rule should work for all the subdomain but not for www.
In the rewrite rule add one more condition at the beginning of the conditions collection:
<add input="{HTTP_HOST}" pattern="^www\." negate="true" />
There is an issue in the URL (HyperLink, Response.Rewrite(), and LinkButton links)..
http://subdomain1.mysite.com/default.aspx is internally rewritten to http://subdomain1.mysite.com/subdomain1/default.aspx
Now the links are created are : http://subdomain1.mysite.com/subdomain1/newpage.aspx
And when we click on the link: it converted to http://subdomain1.mysite.com/subdomain1/subdomain1/newpage.aspx(It shows error as it contains two subfolder path)
I want something like this:
http://subdomain1.mysite.com/default.aspx page internally rewritten to
http://subdomain1.mysite.com/subdomain1/default.aspx or http://mysite.com/subdomain1/default.aspx (I dont know which is ok, or which should be a right one)
and all the hyperlink in the page, should show and work properly:http://subdomain1.mysite.aspx/newpage.aspx
(But it is not showing in this manner. Is it possible and if then how?)