title: xampp server http://localhost/ redirects to http://www.localhost/ and doesn't work
body: <p>I have a drupal website and have been using an <code>XAMPP</code> local server; I have several sites on the server and this morning they all worked fine.</p>
  
  <p>On my main site <code>Site 1</code>, I was getting duplicate sites, google was finding <a href="http://www.site1.com" rel="nofollow">http://www.site1.com</a> and <a href="http://site1.com" rel="nofollow">http://site1.com</a>, so I edited the <code>.htaccess</code> file as follows:</p>
  
  <pre><code># To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  # RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]
  </code></pre>
  
  <p>I removed the # from the last 2 lines and uploaded my site.</p>
  
  <p>Hey presto, no more duplicate site on google, however now when I try and log in to my local server instead of it going to <a href="http://localhost/site1" rel="nofollow">http://localhost/site1</a> it tries to link to <a href="http://www.localhost/site1" rel="nofollow">http://www.localhost/site1</a> instead and I get an error saying </p>
  
  <pre><code>Oops! Internet Explorer could not find www.localhost.
  </code></pre>
  
  <p>My other sites still work fine which suggests it was something to do with the redirect. I have changed the .htaccess file back but it makes no difference.</p>
  
  <p>I have scoured the web with little luck. I have tried changing local host for 127.0.0.1, but I still get the same message.</p>
  
  <p>I'm a newbie and have been tearing my hair out for days now, to no avail. Can someone please help?</p>