I checked my httpd.conf
file and nothing found anything, let me know other areas whr i need to look.
Although my other links are working fine like --
here is a nice article about this helpful feature of Firefox that becomes annoying once you have fixed the problem and still get redirected: Filed under ‘Annoying things I keep forgetting how to fix…’:
To disable this ‘feature’ do the following:
Type about:config in the browser bar
Type browser.fixup.alternate.enabled in the search box that appears
Right click on the browser.fixup.alternate.enabled that appears in the filtered list below and choose Toggle to set the value to false
http://cdivilly.wordpress.com/2013/08/15/disable-firefox-redirecting-to-localhost-com/
I also face that issue. But my issues is now resolved. I just disable the TeamViewer. So the reason behind that issue may be another application running in same port. Thanks @Jibran Kassim.
Judging by your comments, seems like you might be looking at the wrong place. Look at this question.
Perhaps the application installed in the root directory (the one you expect to see when you type http://localhost/index.php
) is configured incorrectly. Locate the application whose index.php file is in the root, then go through its configuration files and see if you can find www.localhost.com
written somewhere. Some applications store their settings in database so that is another place to look at.
I had the same problem, all of my browsers were redirecting http://localhost/mysite
or localhost/mysite
to www.localhost.com/mysite
on manually installed php,apache and mysql system. replacing 127.0.0.1 with localhost was working perfectly means my installation of W.A.M.P perfectly running. i tried to solve it according to Salman way but no luck. i did not look into C:\Windows\System32\drivers\etc\hosts file, i knew even host files do not have 127.0.0.1 localhost entry, doesn't matter at all because it is built in the system by default.
problem was solved by deactivating my avast antivirus shields, which were causing such unusual browser behavior. if you face such a problem you can try deactivating your antivirus shields first before you jump into any deep technical solution.
I know this is a quite old question but just for the same problem, which appeared suddenly. This was due to an issue in the PHP code, and nothing due to Apache configuration.
I checked the file /var/log/apache2/error.log
(Under Linux, I do not know the path for Windows/Mac), which gave me an indication:
[Sat Jun 20 21:49:06.444684 2015] [:error] [pid 24149] [client 127.0.0.1:59150] PHP Fatal error: Can't use method return value in write context in /docs/Cedric/Programmation/PHP/slnslv/src/SLN/RegisterBundle/Controller/MemberController.php on line 80, referer: http://localhost/slnslv/web/
[Sat Jun 20 21:49:06.674815 2015] [core:notice] [pid 1904] AH00052: child pid 1973 exit signal Segmentation fault (11)
[Sat Jun 20 21:49:06.674885 2015] [core:notice] [pid 1904] AH00052: child pid 24149 exit signal Segmentation fault (11)
Fixing the error in PHP with this indication magically solved the problem.
No idea however how a simple PHP error can cause a segmentation fault, which can make the browser (Firefox) thing it should guess a correct domain name.
you cant see localhost by www.localhost.com
you can see by http://localhost
or 127.0.0.1