Localhost and 127.0.0.1 show different content in web browser

2.1k Views Asked by At

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
2

There are 2 best solutions below

0
On BEST ANSWER

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

Now the content is the same.

0
On

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.