---
title: "Configure the MultisiteMiddleware class locally"
slug: "configure-the-multisitemiddleware-class-locally"
abstract: "How to configure MultisiteMiddleware locally for accurate site resolution during local development."
---
# Configure the MultisiteMiddleware class locally

For accurate site resolution during local development, developers are encouraged to simulate production-like domain routing by configuring custom hostnames. This can be done using the [MultisiteMiddleware](https://doc.sitecore.com/sai/en/developers/asp-net/0/asp-net-core-sdk/multisitemiddleware.html "MultisiteMiddleware").

To set up and configure the MultisiteMiddleware to achieve production-like domain routing locally:

1. Find your hosts file:
    - For macOS/Linux - `/etc/hosts`
    - For Windows - `C:\Windows\System32\drivers\etc\hosts`
2. Add the following to point a local domain to `127.0.0.1`:

    ```

    127.0.0.1 sitea.localhost
    127.0.0.1 siteb.localhost
    ```

3. Update the Site Definition in SitecoreAI:
    - Navigate to `/sitecore/content/YourTenant/YourSite/Settings/SiteGroup/Site Definitions`.
    - Open the relevant Site Definition item (for example, `sitea`).
    - Add `sitea.localhost` to the `HostName` field.

This ensures consistency between your local development environment and the content served by SitecoreAI.