7 ms·
Nice! I'm very much in favor of this change. I develop my webserver locally, and it has many subdomains. So I have "www.localhost", "files.localhost", "doc.loc
by byuu 10y ago
Nice! I'm very much in favor of this change.
I develop my webserver locally, and it has many subdomains. So I have "www.localhost", "files.localhost", "doc.localhost", etc.
I have to add each subdomain to my /etc/hosts file before I can use it, as you can't have wildcards in that file. And even then, if I type a new one into Chromium, it will try and redirect me to a Google search result, unless I prefix the whole thing, eg "http://doc.localhost/"; http://doc.localhost/"; once I do that and it connects, then the Omnibar will match the actual localhost entry easily going forward.
This should help anyone in a similar situation of testing their server with subdomains on localhost.
- Scarblac 10y agoI wish whoever owns localhost.org (which resolves to 127.0.0.1) configured it so that *.localhost.org also worked. Would help with the browsers too.
- imtringued 10y agoYou can use xip.io 127.0.0.1.xip.io www.127.0.0.1.xip.io files.127.0.0.1.xip.io doc.127.0.0.1.xip.io all resolve to 127.0.0.1
- yaur 10y agoI use 42foo.com which does exactly that.
- warp 10y agoThere is also lvh.me
- SysArchitect 10y agoDNS rebinding means you shouldn't allow untrusted domains to resolve to a localhost IP address...
- joshka 10y agoFor another memorable one try .localtest.me See http://readme.localtest.me/ http://readme.localtest.me/ for more details.
- nalllar 10y ago> it will try and redirect me to a Google search result, unless I prefix the whole thing, eg "http://doc.localhost/" http://doc.localhost/" Shortcut to avoid being redirected to a search for uncommon TLDs: end with a /, no need for the http:// http://.
- WorldMaker 10y agoSimilarly you can start with just a //, no need for the http:.
- IMcD23 10y agoStarting with // doesn't work in all browsers, such as Safari.
- drostie 10y agoYou know that you do not need to use that naming convention, right? You might as well set up domains for www.pocalhost, files.pocalhost, doc.pocalhost. Or, why even have that part at all? You can just as easily set up the hosts record in /etc/hosts for www, and then visit http://www/ http://www/ and it should work just fine on both Windows and Linux.
- nitrogen 10y agoI'm guessing there might be a cookie or content security policy that requires testing with actual subdomains, so www alone might not work for their usecase. It's also nice to use a name that is guaranteed not to have conflicts, so localhost might be preferable for that reason.