Barnyk
Barnyk

Reputation: 19

Localhost and 127.0.0.1 show different content in web browser

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

Upvotes: 1

Views: 2421

Answers (2)

Anthony
Anthony

Reputation: 2132

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.

Upvotes: 1

Barnyk
Barnyk

Reputation: 19

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

Now the content is the same.

Upvotes: 0

Related Questions