简体   繁体   English

Chrome浏览器不喜欢没有http://的* .loc域名?

[英]Chrome browser doesn't like *.loc domain without http://?

For web development on localhost I'm using domains with .loc extension at the end of a domain name. 对于localhost上的Web开发,我在域名末尾使用扩展名为.loc的域名。

For example: if I work on a site roses.com, the local development domain would be roses.loc (defined in hosts file and IIS as a host-header in binding) 例如:如果我在网站roses.com上工作,本地开发域将是roses.loc(在hosts文件中定义,IIS在绑定中作为主机头)

My preferred browser (the main browser I use for development is Chrome) but unfortunately it does not recognize a domain name with .loc extension as http://rose.loc - it throws me onto a google search page each time I would type in rose.loc (without http://) in the beginning.. 我首选的浏览器(我用于开发的主要浏览器是Chrome),但不幸的是它无法识别扩展名为.loc的域名为http://rose.loc - 每次我输入时它都会把我扔到谷歌搜索页面上rose.loc(没有http://)在开头..

Have you experienced this in a similar way ? 您是否以类似的方式体验过这种情况? Is there some solution to that ? 有一些解决方案吗?

Because during intensive development testing with clearing browser cache and restarting the browser for various reasons, it's getting pretty annoying to be thrown at a google search page instead of the development page where I expect to notice some changes, each time I forget to type in http:// before the url (and Chrome is the one who hides it by default, anyway..) 因为在深度浏览器缓存和重新启动浏览器的密集开发测试期间出于各种原因,在google搜索页面而不是我希望注意到一些更改的开发页面上,每次忘记输入http时都会非常烦人://在网址之前(并且Chrome是默认隐藏它的人,无论如何..)

Google Chrome is pretty "smart" with this. 谷歌Chrome对此非常“聪明”。 It has a list of known-good TLDs and assumes everything else is just a search term that happens to end in a dot followed with some characters. 它有一个已知良好的顶级域名列表,并假设其他所有内容都只是一个搜索词,恰好以点后跟一些字符结尾。

99% of the time that's perfectly fine. 99%的时间完全没问题。 It's "only" us developers and a few people with strange network setups that have to suffer for the good of the majority ;-) 它是“仅”我们的开发人员和一些奇怪的网络设置的人必须为大多数人的利益而受苦;-)

You can try using .local as your TLD, as that's a defined domain for referencing local domain names (at least it's used in some mDNS systems). 您可以尝试使用.local作为您的TLD,因为它是用于引用本地域名的已定义域(至少它在某些mDNS系统中使用)。

The issue has been entered as #30636 in the Chromium bug tracker . 该问题已在Chromium bug跟踪器中输入为#30636 One workaround that often (but not always) seems to work is to append / to your hostname. 通常(但并非总是)似乎有效的一种解决方法是附加/到您的主机名。 So try roses.loc/ . 所以试试roses.loc/

I've created a search engine with a keyword of 'l' (my local TLD is .l). 我创建了一个关键字为'l'的搜索引擎(我的本地TLD是.l)。 The URL for the search engine is http://%sl . 搜索引擎的网址为http://%sl Then, I simply type "l mysite" in the address bar and it takes me to mysite.l. 然后,我只需在地址栏中键入“l mysite”,它就会转到mysite.l。

以下是我为此错误提出的解决方法: http//code.google.com/p/chromium/issues/detail? id = 30636#c38

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM