Rename localhost

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Rename localhost

Postby Johannes58 » 02. June 2016 09:22

Does anyone know if it is possible to rename localhost to read "http://mynet/" for example instead of "http://localhost/"
Johannes58
 
Posts: 2
Joined: 02. June 2016 09:11
XAMPP version: 3.2.2
Operating System: windows

Re: Rename localhost

Postby gsmith » 02. June 2016 18:47

You can, but why?
You can add mynet and have both.
See c:\windows\system32\drivers\etc\hosts (no file extension)
Code: Select all
#
# 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
::1             localhost
127.0.0.1       mynet


You have to open your text editor as Administrator to save any changes and it's effective right away.
gsmith
 
Posts: 194
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win XP to 2012R2/VS 6,9,11,14

Re: Rename localhost

Postby Johannes58 » 02. June 2016 21:13

Although that works, I was looking for a way to change it within Apache...
Johannes58
 
Posts: 2
Joined: 02. June 2016 09:11
XAMPP version: 3.2.2
Operating System: windows

Re: Rename localhost

Postby Altrea » 02. June 2016 22:11

you cannot. The domainname needs to get resolved and that is not the task of Apache.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Rename localhost

Postby gsmith » 03. June 2016 00:23

Look for ServerName in Apache.

However, mynet has to exist and be resolvable which is what adding it to the hosts file is for.
Apache, unless you have specific virtualhost/s, will answer anything pointing to your IP without regard for what the ServerName is set to.
gsmith
 
Posts: 194
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win XP to 2012R2/VS 6,9,11,14


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 45 guests