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: 278
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win 10/2012R VS 14,15,16

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: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 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: 278
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win 10/2012R VS 14,15,16


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 77 guests