Page 1 of 1

Setting for avoiding port number in url for custom ports

PostPosted: 20. September 2018 14:53
by optimisticwalker
What could be the possible server setting for avoiding the port number in url in case of custom non ssl port like 78 and ssl port like 434 instead of standard non ssl port 80 & ssl port 443?

Thanks,

Re: Setting for avoiding port number in url for custom ports

PostPosted: 20. September 2018 15:06
by Nobbie
None.

Port 80 is default for http, Port 443 is default for https. You cannot leave the port numbers, if they have different values than 80/443,

Re: Setting for avoiding port number in url for custom ports

PostPosted: 20. September 2018 15:13
by optimisticwalker
Any redirection rule can do that?

Thanks,

Re: Setting for avoiding port number in url for custom ports

PostPosted: 20. September 2018 15:15
by Nobbie
No, nothing. If your server does not listen to port 80, you MUST specify the port in the URL (same for port 443 in case of https).

If you have a router and you have your server running locally, you can apply a portforwarding from port 80 to port 78 (if your router supports that feature). Thats the only option which comes to my mind. The router then is listening to port 80, but redirects certain request to the Xampp server on port 78.

Re: Setting for avoiding port number in url for custom ports

PostPosted: 20. September 2018 15:21
by optimisticwalker
Many users may look for the answer of this question in future.

Thanks,

Re: Setting for avoiding port number in url for custom ports

PostPosted: 20. September 2018 15:27
by Nobbie
optimisticwalker wrote:Many users may look for the answer of this question in future.


This already has been asked very often, but ususally there is no solution (only that workaround with the router, but this of course only runs locally, not at a webhoster/provider). And it is one (of many) reasons, why we strongly recommend NOT TO CHANGE the default ports for Apache.

Re: Setting for avoiding port number in url for custom ports

PostPosted: 20. September 2018 16:00
by optimisticwalker
Another good solution is to use custom non ssl port with default ssl port like 78 & 443 in order to avoid port number in url. the default http// tcp port remains free for other apps then.

Thanks,

Re: Setting for avoiding port number in url for custom ports

PostPosted: 20. September 2018 16:35
by Nobbie
optimisticwalker wrote:Another good solution is to use custom non ssl port with default ssl port like 78 & 443 in order to avoid port number in url. the default http// tcp port remains free for other apps then.


Sorry, but this no solution at all, how should a browser know to which port he should send a request, when there is no fixed default port?? Think about twice, before answering. A browser gets an URL and he already must decide, which port to use in order to connect to the remote webserver. How can he know the port, if it is omitted and there is no fixed default port?