我想在Windows 2008 R2服务器上做一些测试。也就是说,让一个URL重定向到localhost
。如何将URL重定向到本地主机?
例如,让"http://mysample.mydomain.com/index.html"
实际访问“http://localhost/index.html”。有什么办法可以做到这一点?
我试图编辑windows\system32\drivers\etc\hosts
文件,添加127.0.0.1 -> mysample.mydomain.com
映射,但它不起作用。看起来127.0.0.1
和localhost
是不一样的。 我可以访问“http://localhost/index.html”,但我无法访问“http://127.0.0.1/index.html”!
在此先感谢!
我认为这应该被迁移到superuser.com –