---
title: Configuring nested websites
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/running-multiple-sites-on-a-single-domain.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).

A nested website is a site that users can access through a URL sub-directory under the domain name of a different website. The following steps demonstrate how to create two Kentico sites that utilize nesting:

1. [Install](https://docs.kentico.com/k10/installation.md) two Kentico web projects into separate folders.
   - Choose folder names different than the virtual directory names you plan to use in the URL. This prevents collisions when setting up the IIS. For example:

     - **Inetpub/wwwroot/NestedWeb/Web1**
     - **Inetpub/wwwroot/NestedWeb/Web2**

> **Info:** You now have two completely independent instances of Kentico, each with its own web project and database.

2. Open your **Internet Information Services (IIS) Manager** console (_Start -> Control Panel -> Administrative tools -> Internet Information Services (IIS) Manager_).
3. Create two applications under your web site:

   - **\[IIS web site]/Kentico1** - set the **Physical path** to the _CMS_ folder of _Web1_
   - **\[IIS web site]/Kentico1/Kentico2** - set the **Physical path** to the _CMS_ folder of _Web2_ (the child website)

> **Info:** You now have two independent applications in IIS, one nested under the other.

4. Edit the **web.config** of the nested application (_Web2_) and remove all __, __ and __ definitions. This avoids duplicate definitions in the two applications.

   > **Note:** If you have any additional custom keys in these configuration sections, ensure that they are not duplicated in the two _web.config_ files, i.e. that they are only added in one of the two files.

   ```html

   <system.webServer>
     <modules>
       // Remove or comment out all keys in this section
     </modules>
     <handlers>
       // Remove or comment out all keys in this section
     </handlers>
     <security>
       // Remove or comment out all keys in this section
     </security>
   </system.webServer>

   ```

The websites are now accessible via nested URLs. You can configure the websites independently without any issues.

## Additional configuration for Staging

This section describes how to set up [Content staging](https://docs.kentico.com/k10/deploying-websites/content-staging.md) on nested websites.

Staging uses sections in the _web.config_ that collide on nested websites. Config files are inherited within the IIS virtual directory structure (even when the projects are not nested on the file system), but you cannot have the same section of _web.config_ twice in the config file.

If you [configure staging](https://docs.kentico.com/k10/deploying-websites/content-staging/configuring-content-staging.md) from the **Kentico1** site to the **Kentico1/Kentico2** site, the inner project may have issues with the configuration.

If you get the "**The username token has already been added**" error message, some of the configuration is duplicated. User name token authentication is defined in the policy file, which is referenced from the **** section.

> **Warning:** You need to **remove the whole  section** from the **web.config** of the **nested web project (Web2)**. Do not remove the section from the Web1 (outer) project, since both websites will use this configuration.

Staging between the nested sites should now work correctly.
