Half a year ago I installed XAMPP on my Computer with a few virtualhosts ending with ".dev". When I now try to open those websites in Chrome it gives me the error ICANN Name Collision. After some research I found out that im not the only one with the Problem and that the only way around is to Change to ".local".
So I changed my Host File and httpd.config restarted the System/FLushed the DNS Cache but it's not working anymore. I can't acces the Server with the new local Domain names. When I use IE and type in example.dev (or whatever adresse i used before) it still redirects to localhost but not to the old Directory. Therefore I guess that Apache noticed the Change and is on the new configuration but my Browser somehow tell me they can't find the Server.
What is the most likely Error? Which Error Logs might be helpful?
If I use the XAMPP/Apache Shell and type in httpd -S it prints me out the current v-Host Settings like in the v-host.config file.
Host File:
127.0.0.1 db.local
127.0.0.1 test.local
127.0.0.1 www.test.local
127.0.0.1 host.local
127.0.0.1 www.host.local
apache\conf\extra\httpd-vhosts.conf:
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "C:/XAMPP_DEV/htdocs"
</VirtualHost>
<VirtualHost *:80>
ServerName db.local
DocumentRoot "C:/XAMPP_DEV/phpmyadmin"
</VirtualHost>
<VirtualHost *:80>
ServerName test.local
ServerAlias www.test.local
DocumentRoot "C:/XAMPP_DEV/htdocs/test"
</VirtualHost>
<VirtualHost *:80>
ServerName host.local
ServerAlias www.host.local
DocumentRoot "C:/XAMPP_DEV/htdocs"
</VirtualHost>
Thats my V-Host Configurtion and Host file; I removed all the lines starting with #.
Intro..
It's an old question that came to me because I was looking into something very similar. But happens that I know the answer just not how to apply it to an Android phone I do not want to "root". Anyway.. I don't know if it will help you - probably not as you might have solved already - but it can help others.
Just explaining:
.dev
became a new gTLD. So, some people own these domains.You can't have a fixed IP pointing to it - security and legal reasons. That's why your browser don't recognize it - the DNS servers of you internet provider (or you chosen DNS servers) actually.
BUT..
There is a way. You don't have to use
.local
.Local browsers will recognize it if your
hosts
file (the system file, not the server file with similar name) point to the local machine that hosts the website. Or if you local DNS server points that address to your local machine or server. Both scenarios will enforce the IP provided by you.Most developers won't be using a DNS server. I will take it for granted because if you have a DNS server, you probably know more than I do (which isn't something very difficult to accomplish.. :) and wouldn't, probably, be having these issues.
Fixing it..
Assuming you have the same configuration as you previously had - with
.dev
- you simply can go to your computer (or every computer in the local network - depends on your case) and editC:\Windows\System32\drivers\etc\hosts
file under Windows. The same for Linux would be under/etc/hosts
.You can put at the end of the file:
IP_OF_THE_MACHINE
will simply be the IP of the 'host' of the page being developed:127.0.0.1
;yourfakedomain.dev
I think it is self-explanatory..( Should not be an issue but I would change those * to the fake domain name you will use, like from
<VirtualHost *:80>
to<VirtualHost test.dev:80>
. Of course, the proper name for each case. )Try this and check the result. Should be all functional.
Notes..
You always have to edit at least three files:
httpd-vhosts.conf
);httpd.conf
to select the IP and port range AND to include the virtual hosts file (or files);hosts
file of you system to enforce things like 'fake domain names' (test.dev, mymon.is.cool, hi.world.. etc - use your imagination);It should always work with this. Unless you have conflicts with older or bad configurations (remove configuration files and uninstall everything; reinstall and start afresh) or something with your router.