Configure multiple sites
Describes how to set up a multi-tenant instance to host multiple applications.
Configure multiple sites in two stages:
- In IIS, configure host name mapping to route requests to applications, either by listening on any hostname or on specific hostnames.
- In the Optimizely CMS admin view, add a website.
Add an application from the admin view
For administrators.
If you configure the IIS application to respond to any hostname, you can launch applications from the CMS admin view without additional configuration. To define multiple applications, select the Applications tab and add or update applications there. The application URL acts as the default URL when CMS generates links.
Each application requires only a root page and a URL. CMS stores both values in the database and provisions the application automatically. When you launch an application, configure it to use application-specific assets if needed. For example, a campaign application might keep its assets in folders scoped to that campaign.
By default, one installed application has its IsDefault property set to true. Add host mappings such as partner.examplesite.com or customer.examplesite.com, and optionally bind each mapping to a specific language. Add additional hosts that redirect to the main host or to a specific language host that serves as the primary host and the redirect target for that language. Redirects apply to content only. To redirect an entire application, use IIS settings.
Develop for multiple applications
For developers.
Implementation code that runs under a web request (such as templates) does not need to handle multiple applications because CMS automatically routes each request to the correct application. Access the current application through the Application.Current property in the EPiServer.Applications namespace.
Scheduled jobs are one case where code must handle multiple applications explicitly. Use the IApplicationRepository interface to list applications and act on each one. Use the Application.Current property to access settings shared between applications when CMS cannot determine the current application: the root page is one such setting.
Security across applications
Logging out of one application in a multi-application setup does not log the user out of the other applications. Forms Authentication stores the authentication token in a per-domain cookie in the visitor's browser by default, so each application maintains its own session.
Updated about 14 hours ago
