开发者

How to map SubDomain to the subfolder?

Hi I'm using a BlogEngine.net for my blog and I would like to create 5 different subdomains and point to different subfolders(not redirecting). For example:

firstsubdomain.domain.com - domain.com/posts/hello开发者_Go百科world.aspx
firstsubdomain2.domain.com - domain.com/posts/helloworld2.aspx
firstsubdomain3.domain.com - domain.com/posts/helloworld3.aspx

Thank you in advance for working example. I'm using asp.net 3.5, C#, Windows Server 2008, IIS 7


I think you have to create a new web site in IIS manager, point it to the folder where the files are, and set the hostname to subdomain.domain.com


You have to use URL rewriting if you limitation on IIS and if you have full control on IIS then can do using .htaccess:

Check these links for more details:

Web.config and mapping subdomains to folders

http://learn.iis.net/page.aspx/465/url-rewrite-module-configuration-reference/

https://help.brinkster.com/KB/a125/how-do-i-redirect-a-domain-or-subdomain.aspx#b3

check this Ionic's ISAPI Rewrite Filter

IIRF is an ISAPI filter that does URL Rewriting for IIS. It's small, FREE, and easy to use. It is easy to install, fast, and powerful. You can get Search-Engine Friendly (SEF) or Search-Engine Optimized (SEO) URLs easily on IIS 6, 7, or 7+. It works with what you have, and there's help available to get you going. You can get the source code to inspect it or even modify it yourself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜