Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the :port number from the end of an IIS URL?

Tags:

url

port

iis

In IIS, I noticed when you use the default ports (80 for http and 443 for https) the port number doesn't display at the end of the URL in your browser. However, if you use a different port it will display.

Example: Default port generates link: http://www.example.com

Custom port generates link: http://www.example.com:8301

Is there a setting you can change to make the port (in this case, :8301) not display without using the defaults?

like image 487
AlbatrossCafe Avatar asked Jun 05 '15 18:06

AlbatrossCafe


People also ask

Is port number optional in URL?

Well-known port numbers for a service are normally omitted from the URL. Most servers use the well-known port numbers for HTTP and HTTPS , so most HTTP URLs omit the port number. A path. The path identifies the specific resource in the host that the web client wants to access.

How do I change the port of a website in IIS?

Double-click Internet Information Services (IIS) Manager. In the Internet Information Services dialog box, expand local computer ►Sites and right click Default Website and select Bindings. Select the http setting and click Edit. Change the port number to 80 and click OK.


1 Answers

80 is a default port for HTTP connections. http://example.com = http://example.com:80

443 is a default port for HTTPS connections. https://example.com = https://example.com:443

If you are hosting on an other port, you have to include it in the URL.
It's not a IIS rule - it's about HTTP in general. You cannot configure the server in such way that http://example.com will work with port 8301 and I can't imagine any situation when it can be useful. I strongly believe that 80 port is chosen by default on a browser-side but not assigned on a server-side.

If you want users to reach this website by http://example.com URL and it must be a main page then swap your 8301 and 80 ports WebSites' bindings.

like image 127
Yeldar Kurmangaliyev Avatar answered Oct 19 '22 19:10

Yeldar Kurmangaliyev