Hostnames
Bind different hostnames to multiple websites within one C1 CMS instance
In C1 CMS, you can create and host multiple websites in one installation. Each website has its own homepage (the root page of the website).
By default, each site is accessed as:
http[s]://<hostname>[/<language code>]/<homepage>
For example: http://www.contoso.com/Home
or http://www.contoso.com/Shop
You can however add an individual hostname binding to each of the website created in C1 CMS.
http://www.contoso.com/Home
> http://www.contoso.com
http://www.contoso.com/Shop
> http://www.contoso-shop.com
Note: You can only use existing hostname bindings. You should configure them outside C1 CMS (DNS Servers, bindings on IIS7 etc).
The hostname bindings as well as some other settings allow you to have shorter URLs to the pages on your website.
In addition, you can choose to:
- include or exclude the homepage title in the URL path (
http://www.contoso.com/Home/About
vs.http://www.contoso.com/About
) - include or exclude the language URL mappings (
http://www.contoso.com/en-us/About
vs.http://www.contoso.com/About
) - set up a custom Error 404 page URL
- specify one or more hostname aliases (
http://www.contoso.com
,http://contoso.com
)
To add a hostname binding:
- In the System perspective, expand URL Configuration, select Hostnames, and click Add Hostname.
- In the window that opens, specify these required values:
- Hostname: The hostname you bind to your CMS Website (e.g. ‘contoso.com’)
- Page: The root page (homepage) of the website
- If necessary, specify one or more optional values:
- Include homepage URL Title: If checked, the URLs on the website will include the homepage title (
http://www.contoso.com/ About
>http://www.contoso.com/Home/About
, whereHome
is the homepage title) - Include language URL mapping: If checked, the URLs on the website will include the language mapping (
http://www.contoso.com/About
>http://www.contoso.com/en-us/About
) - Custom 404 Page: The hostname-specific URL to which all non-resolved requests are redirected. You can use a relative or an absolute path (e.g. ‘/not-found’, '~/not-found' or 'http://www.contoso.com/')
- Alias hostnames: A set of hostnames from which all requests redirected to the current hostname. It can be used, for example, for redirecting from ‘www’ to non-‘www’ hostnames or vice versa. (Start each alias at a new line.)
- Include homepage URL Title: If checked, the URLs on the website will include the homepage title (
- Save the changes.
- Restart the server (Tools | Restart Server).
Note: Whenever you change something about the URL paths (include the homepage URL title, for examle), make sure that the path to the custom 404 page is updated accordingly if the relative one is used.
Important Notes
- Hostnames in URLs are only active, when a "known" hostname is used. If you are contacting the website on an “unknown" hostname, the URL system will switch back to the "verbose path" mode and stop using hostnames. This ensures that a copy of a website (copied to a local host or a developer server) can be accessed without redirecting visitors to the live site.
- If you run C1 CMS using the web server built into Visual Studio (called “Cassini”) a limitation in this server prevents hostnames from working. All request URL’s will be rewritten to “localhost” as the hostname, preventing C1 CMS from seeing what was originally written.