how to change default localhost

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

how to change default localhost

Postby curious30 » 28. May 2016 05:56

sorry im newbie,

i want ask how to change my default localhost
actually now i use localhost:81/
what i know localhost/ normaly use port 80

but i want change localhost:81/ = localhost/
so when i write localhost/ automatically use port 81
thx b4 :)
curious30
 
Posts: 1
Joined: 28. May 2016 05:47
XAMPP version: v3.2.2
Operating System: windows 10

Re: how to change default localhost

Postby Altrea » 28. May 2016 12:20

This is technically not possible.
Every request needs to send a port number.
Even if none is given a port number will be used related to the default port of the protocol.

So if your protocol starts with http:// port 80 is the default port.
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: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: how to change default localhost

Postby Nobbie » 28. May 2016 14:55

curious30 wrote:but i want change localhost:81/ = localhost/


As Altrea already said, this is impossible, as the default port for http is port 80, what cannot be changed. You must keep in mind, that at first a client puts in an URL in his browser. This happens first, then the browser has to analyze that URL and sends either a DNS request to a DNS Server (in order to translate a domain name into an IP number) and after the browser sends an TCPIP request to that IP including a valid portnumber. If the client specified a port, the browser will use this port, if the client did not specify a port, the browser will take the standard default port for http and that is port 80.

All this happens without any interaction to your server, only after this very first action, the request will be received by your (Xampp) server. As you see, you dont have any chance to tell your server to use a different port, because this port already has been chosen by the remote client (browser). Its simply too late already. Therefore you cannot change anything, this is the way how TCPIP works.
Nobbie
 
Posts: 8770
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 75 guests