Return to doc.sitecore.com

  hostName
Prev Next

The host name of the incoming URL. May include wildcards (ex. www.site.net, *.site.net, *.net, pda.*, print.*.net, *site*). 

A mask cannot simply be a wildcard. To make a website pick up all the host names that haven't been defined in the site definitions, remove the hostName attribute.

If the hostName attribute is not set for a certain site in the web.config file, all the hostnames defined in the hosts file match. If this attribute is set for a certain site, this site will be accessible only with the specified hostname.

Important Note: The parameter hostName is case sensitive and must be spelled hostName not hostname otherwise multiple logical sites will not work

For example, consider the following host configuration: 

127.0.0.1    localhost
127.0.0.1    mysite.com
127.0.0.1    mysite.net 

And the following <site> definition in the web.config file:

<site
        
name="test"
        hostName
="mysite.com"
        virtualFolder
="/"
...

The site defined above will be accessible only via mysite.com host name.

Default value: all hostnames defined in the hosts file.


Prev Next