What is the recommended approach to add static subdomains to a website?

这一生的挚爱 提交于 2019-12-07 13:04:44

问题


I would like to create a few static subdomains like:

mycategory.mydomain.com

in a rather small website and would like it to point to the folder:

mydomain.com/mycategory

without showing such redirection in browser address bar.

What is an easiest way to achieve it? I can do it in either IIS settings, asp.net, C# code, etc

I guess there are better ways then creating a few separate Sites in IIS - one for each subdomain.


回答1:


Setup multiple websites in IIS and assign a unique hostheader to each one of them (mycategory1.mydomain.com, mycategory2.mydomain.com, etc). Point each website to its destination folder.

More about hostheaders:

http://www.google.com/search?q=iis+host+headers




回答2:


IIS 7 supports URL rewrite better than any previous versions, http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/

But there are also third party solution.

Like @adrianbanks suggested, serverfault.com is a better place to discuss such configuration only questions :)



来源:https://stackoverflow.com/questions/2845056/what-is-the-recommended-approach-to-add-static-subdomains-to-a-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!