---
title: Running multiple sites on a single domain
related:
  - https://docs.kentico.com/k10/configuring-kentico/managing-sites/setting-up-multiple-websites.md
  - https://docs.kentico.com/k10/configuring-kentico/managing-sites/setting-up-multiple-websites/configuring-nested-websites.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

This page describes how to run multiple websites in separate sub-folders on a single domain. In this scenario, you do not need to obtain new domains for each site.

## Example - Installing two sites onto a single domain

1. [Install](https://docs.kentico.com/k10/installation/installing-kentico-custom-installation.md) a Kentico web project to the following folder: **C:\inetpub\wwwroot\kenticofolder**.

   - In the installer, choose **Custom installation** and **Built-in web server in Visual Studio** (does not create a virtual directory).
2. Open your **Internet Information Services (IIS) Manager** console (_Start -> Control Panel -> Administrative tools -> Internet Information Services (IIS) Manager_).
3. Create a new virtual directory named **kenticoweb**.
   - The name of the virtual directory must be different than the folder where you installed the web project.
   - Set the **Physical path** to a non-website folder in the root of a local disk. Ideally, create an empty folder for this purpose, for example: _c:\empty_
4. Create two IIS applications under **kenticoweb** named **web1** and **web2**.

   - Set the **Physical path** of both applications to the web site folder of the installed project (**C:\inetpub\wwwroot\kenticofolder\CMS** in this example).
   - Set the application pool according to the type that you specified in the installation of the Kentico web project.
5. Open your browser and type in either **http://localhost/kenticoweb/web1** or **http://localhost/kenticoweb/web2**.
6. Sign in to the Kentico administration interface and open the **Sites** application.
7. [Install](https://docs.kentico.com/k10/configuring-kentico/managing-sites/installing-new-sites.md) both sites. Set the **Site domain name** fields:

   - Website 1: **localhost/kenticoweb/web1**
   - Website 2: **localhost/kenticoweb/web2**

Now when you go to **<http://localhost/kenticoweb/web1>**, you will see website 1. If you go to **<http://localhost/kenticoweb/web2>**, you will see website 2.

### Synchronizing global data for the sites

To ensure the synchronization of settings and global objects between the two sites, you need to set up a [Web farm](https://docs.kentico.com/k10/configuring-kentico/optimizing-website-performance/setting-up-web-farms.md) environment.

1. Sign in to the Kentico administration interface on one of the sites.
2. Open the **Settings** application.
3. Select the **Versioning & Synchronization -> Web farm** category.
4. Select **Automatic** as the **Web farm mode**.
5. Click **Save**.
6. Add the following key to the __ section of the **web.config** file in the installation directory shared by both websites:

   ```html

   <add key="CMSWebFarmSynchronizeFiles" value="false" />


   ```

The system automatically creates web farm servers for the applications and performs synchronization. The _CMSWebFarmSynchronizeFiles_ web.config key disables synchronization of files, which is not needed since the applications already use the same physical folder.

### Avoiding file system conflicts

To prevent problems with file conflicts for [web analytics](https://docs.kentico.com/k10/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/configuring-web-analytics.md) log files and [smart search indexes](https://docs.kentico.com/k10/configuring-kentico/setting-up-search-on-your-website/enabling-search-indexing.md), you need to configure the application to use a shared file system:

> **Note:** **Hotfix requirement**: The following process only works after applying [hotfix 10.0.43](https://devnet.kentico.com/download/hotfixes) or newer.

1. Open the Kentico web project in Visual Studio (using the **WebSite.sln** or **WebApp.sln** file).
2. Create a [custom module class](https://docs.kentico.com/k10/custom-development/creating-custom-modules/initializing-modules-to-run-custom-code.md).
   - We recommend adding the class into a custom _Class library_ project within the Kentico solution.
3. Override the module's **OnInit** method and create a [custom storage provider](https://docs.kentico.com/k10/custom-development/working-with-physical-files-using-the-api/configuring-file-system-providers.md) that handles the application's entire file system as shared storage:

   ```csharp

   using CMS;
   using CMS.Base;
   using CMS.DataEngine;
   using CMS.IO;

   // Registers the custom module into the system
   [assembly: RegisterModule(typeof(CustomSharedStorageModule))]

   public class CustomSharedStorageModule : Module
   {
       // Module class constructor, the system registers the module under the name "CustomSharedStorage"
       public CustomSharedStorageModule()
           : base("CustomSharedStorage")
       {
       }

       // Contains initialization code that is executed when the application starts
       protected override void OnInit()
       {
           base.OnInit();

           // Maps the application's entire file system to the same location, but with the "shared storage" flag enabled
           var sharedFileSystemProvider = new StorageProvider(null, "CMS.FileSystemStorage", isSharedStorage: true);
           sharedFileSystemProvider.CustomRootPath = SystemContext.WebApplicationPhysicalPath;
           StorageHelper.MapStoragePath("~/", sharedFileSystemProvider);
       }
   }

   ```
4. Save the file. If your project is installed in the web application format, rebuild the solution.

With a shared file system, the system automatically avoids file name collisions for smart search indexes and web analytics logs.

Your websites should now work without issues.
