Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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)

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..

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..)

like image 834
Denis Avatar asked Oct 24 '11 15:10

Denis


1 Answers

Google Chrome is pretty "smart" with this. It uses 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. 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).

The issue has been entered as #30636 in the Chromium bug tracker. One workaround that often (but not always) seems to work is to append / to your hostname. So try roses.loc/.

like image 102
Joachim Sauer Avatar answered Sep 23 '22 00:09

Joachim Sauer