[英]How can I make it so my browser never tries to reintpret localhost as www.localhost.com?
I'm working with Firefox, but I'm sure answers for all browsers could be useful. 我正在使用Firefox,但可以肯定所有浏览器的答案都可能有用。 When my browser can't find localhost:8000, it tries www.localhost.com:8000.
当我的浏览器找不到localhost:8000时,它将尝试www.localhost.com:8000。 I don't want it to ever do that because then I have to retype localhost.
我不希望它那样做,因为那样我必须重新输入localhost。
Type about:config
in the browser bar. 在浏览器栏中键入
about:config
。
Type browser.fixup.alternate.enabled
in the search box that appears. 在出现的搜索框中,键入
browser.fixup.alternate.enabled
。
Right click on the browser.fixup.alternate.enabled
that appears in the filtered list below and choose Toggle
to set the value to false
. 右键单击显示在下面过滤列表中的
browser.fixup.alternate.enabled
,然后选择Toggle
将值设置为false
。
Answering my own quesiton, I found a solution to the problem. 在回答我自己的问题时,我找到了解决该问题的方法。 You can simply set your hosts file to redirect www.localhost.com to 127.0.0.1.
您只需设置主机文件即可将www.localhost.com重定向到127.0.0.1。 On Mac the hosts file is /etc/hosts.
在Mac上,hosts文件是/ etc / hosts。 There is a similar file for Windows, and probably Unix/Linux as well.
Windows有一个类似的文件,也可能是Unix / Linux。 You can add this line to the file:
您可以将以下行添加到文件中:
127.0.0.1 www.localhost.com 127.0.0.1 www.localhost.com
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.