Setting up multiple websites
Kentico allows you to run any number of websites from a single installation. The websites share the same web project (code base) and database. All sites run under a single web site in IIS.
Using separate installations for each site
It is recommended to run separate instances of Kentico for every website in the following scenarios:
- Your websites contain a very large number of pages and high performance is a critical requirement.
- Your customers have very different requirements and you need to customize shared parts of the system, such as the administration interface or the structure of shared database tables.
- Your customers are very sensitive to security and you do not want to risk that other clients will get access to other websites because of an administrator’s mistake.
The following sections demonstrate how to set up multiple websites on an example of two sites:
- mysite.com
- mysite2.com
Creating multiple sites in Kentico
Open the sites application.
Create two websites.
- You can either import existing websites or create new websites using the New site wizard.
Edit () each website and set the Site domain name values (without the www prefix and http:// protocol).
Make sure both sites are running.
- You can check the site status on the main site list.
Make sure you have valid license keys for both domains in the Licenses application.
Configuring multiple sites on a local IIS server
Open your Internet Information Services (IIS) Manager console (Start -> Control Panel -> Administrative tools -> Internet Information Services (IIS) Manager).
In the tree, right-click Sites and select Add Web Site.
Enter the following details:
- Site name: mysite.com
- Physical path: disk path to the location of your site’s web project (where the application’s web.config file is stored).
- Host name: www.mysite.com
Click OK.
- The site appears under the Sites node.
Right-click the site and select Edit bindings.
Click Add.
Enter the domain name of your second website as the Host name and click OK.
Add two more bindings for both sites without the www prefix.
Your new IIS web site is now configured to handle all incoming requests for domains mysite.com and mysite2.com. You may need to ask your network administrator to redirect the domain in the DNS records to your website. When you open http://www.mysite.com and http://www.mysite2.com (or your own domain names) in a browser, you should see two different websites.
Testing domains
If you do not own the domains, you can test the configuration by modifying the server’s C:\WINDOWS\system32\drivers\etc\hosts file.
For this example, add the following lines to the end of the file:
127.0.0.1 mysite.com
127.0.0.1 www.mysite.com
127.0.0.1 mysite2.com
127.0.0.1 www.mysite2.com
Note: These are client settings, so the website will only work when accessed from a browser on the server machine.
Multiple websites on a single domain
If you cannot use multiple domain names for your website, you can differentiate websites by subfolder (virtual directory). See Running multiple sites on a single domain for more details.