3

When adding a new website to IIS, the Binding section requires the host name, and gives an example as:

Example: www.contoso.com or marketing.contoso.com

enter image description here

When creating my website for zuggler.com, when should I include the www prefix?

Note that I will most likely use my web.config file to redirect zuggler.com requests to www.zugger.com.

Does it make any difference if I include the www prefix in the Host name box when creating a website?

2 Answers 2

2

In essence, you don't need to provide a host name here, however if you do then clients must use that hostname. If you are redirecting from zuggler.com to www.zuggler.com and you want to add a host name, you only have to enter the latter. If you want people to be able to type both without redirecting, then you have to add two bindings as per below.

From TechNet:

Type a host name if you want to assign one or more host names, also known as domain names, to one computer that uses a single IP address. If you specify a host name, clients must use the host name instead of the IP address to access the Web site.

If this Web site is available on the Internet, type the domain name of the Web site as users will type it in a browser, for example, www.contoso.com. If your Web site has more than one domain name, such as www.contoso.com and contoso.com, you must create a separate binding for each host name.

If your Web site is available on an intranet, you do not have to specify a host name if users will type the server name in a browser, for example, http://server_name. However, if the DNS server in your environment is configured to store other names for this Web server, you can create a separate binding for each host name so that users can use the other names stored by the DNS server.

2
  • Thanks, but I do need to provide a host name here. If I do not, then I get an error that an app is already using port 80. Jun 5, 2017 at 3:41
  • Ah, right, so you already have a binding on that port. So by adding another binding you are specifying a second (or subsequent) host name you want to bind to the same port. You have two options: either (a) remove the host name specified in the other binding, and don't create a second binding but instead set up redirection from zuggler.com to www.zuggler.com, or (b) add the second binding with the second address. Depends what you want people to see in the address bar. A second binding with no redirect means people can browse at zuggler.com.
    – pcdev
    Jun 5, 2017 at 3:47
1

I would add the binding with the www. hostname, by default I always do it for some reasons;

1) If you add later a SSL certificate it must match your hostname. the www. is likely to be used there, unless you buy a wildcard SSL certificate.

2) On the HTTP/1.1 RFC and later (https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html) the browser always send the Host header to the remote server, thus the website in IIS without a hostname binding fallback to be used only if someone use the direct IP, or if only one website is hosted on your IIS. (but that break the point 1)

So you could use the www. binding, and leave the one without binding to redirect to that one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .