Localhost and 127.0.0.1 show different content in web browser

拥有回忆 提交于 2019-12-11 07:56:11

问题


When I enter 127.0.0.1 to web browser, it shows page /var/www/index.php as I expected, but when I enter localhost it shows "a simple hello world" html page which I cannot find in the computer.

I used find, grep and other similar tools, but no luck.

Can you please tell me why localhost shows another content then 127.0.0.1 in the web browser?

I have installed apache, mysql and php on my ubuntu 14.04 and Document Root is set to /var/www/. There were previously installed apache, postgresql and php (which I removed), maybe should I check some old exist config files?

/etc/hosts is set to

127.0.0.1    localhost

回答1:


As requested in comment I post it as answer.

Web browsers use cache and in some cases your changes are not reloaded. So refreshing using Ctrl+R, Ctrl+f5 or disabling cache in your settings may be useful.




回答2:


I only needed to press F5 button in order to refresh the localhost page in my web browser.

Now the content is the same.



来源:https://stackoverflow.com/questions/41212704/localhost-and-127-0-0-1-show-different-content-in-web-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!