change localhost domain when running locally

老子叫甜甜 提交于 2019-12-20 05:13:44

问题


I am using Visual studio as my IDE is developing a .net web application.

I use my local IIS7 web server to run the application.

It runs under the url -> http://localhost/AppName/

I want the change this to -> http://localhost.appname.com/AppName/

I have added the following host file entry 127.0.0.1 localhost.appname.com

This now mean I can access the site via http://localhost.appname.com/AppName/ like I wanted.

I have one issue though, if I run the site via "Start Debugging" (F5), the site runs in the domain http://localhost/AppName/ .

What changes do I need to make to the web application to get it to start with domain http://localhost.appname.com/AppName/


回答1:


The startup page can be set via project properties => web. Typically I find the best option is "do nothing" (I'll invoke the page I want in the browser I want manually)



来源:https://stackoverflow.com/questions/4270516/change-localhost-domain-when-running-locally

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