IIS Point new subdomain to existing virtual directory

徘徊边缘 提交于 2020-01-15 07:37:46

问题


So Currently I have a site accessible by http://hostname/myvirtualdirectory/home.aspx If you go to http://hostname/myvirtualdirectory it automatically goes to home.aspx... good!

However when I go to http://hostname it gives the IIS start page.

Question 1: How do I make this redirect to the virtual directory myvirtualdirectory/home.aspx

I have pointed a subomdain mysubdomain.myurl.com at the server, everything works pretty much the same if I go to http://mysubdomain.mysite.com/ I get the start page but going directly to http://mysubdomain.mysite.com/myvirtualdirectory does go to the home.aspx page

Question 2 Once I point everything correctly in the answer to question 1 do I need to do anything extra to handle the subdomain?

Thanks!


回答1:


I'm going to assume you're using IIS 7.0 or above.

Answer to question 1) Ensure you have the HTTP Redirection feature installed, and then setup a redirct on the root website, details here: http://www.iis.net/configreference/system.webserver/httpredirect

Answer to question 2) You don't need to do anything extra to handle the sub domain unless you've set up multiple websites on the server, from your question I'm guessing that's not the case.



来源:https://stackoverflow.com/questions/19386465/iis-point-new-subdomain-to-existing-virtual-directory

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