Hi
I've been working on a joomla site on my local windoes vista computer using WAMPSERVER vrs2 and with apache.

Something went wrong with apache and windows warned me and turned it off. Since then I can't use http://localhost (or the shortcut on the wampserver menu 'localhost' to connect.

However I CAN connect using http://127.1.1.1 and this is the workaround I've been using for a week now. Anyone know how i can get my 'localhost' working back to normal?

Thanks for your time.

Open Notepad/Wordpad and navigate to
<Your Windows Drive (C:/)>/windows/system32/drivers/etc/hosts
(You might need to change Text Document (*.txt) to all files to see it)
It should look something like this:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost

Add this line to the bottom of the file:

127.1.1.1 localhost
so your hosts should look like this:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
127.1.1.1	localhost

Hope that helps,
Sam R

check you hosts file in notepad.

start - run
%windir%/system32/drivers/etc

If your in a work group then this file controls you manual dns mappings.

Your should have a default entry:

127.0.0.1 localhost

sorry shoud have refreshed the page !

Just a note I would not have two entries using the same host name.

sorry shoud have refreshed the page !

Just a note I would not have two entries using the same host name.

Yer soz, i wrote that during a Geography lesson and I wasn't thinking propperli :D

Thanks for that. By the time I had seen your reply I had already figured this out (actually remembered that there was a 'variable - name' pairing in hosts file. And yes localhost had somehow been removed. I replaced it and all is working fine. Thank you for your help.
Must check my profile though - don't remember getting any emails telling me a reply was made to this post - thanks again.

can't change hosts file, it said "read only" - "access denied"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.