Configure the MultisiteMiddleware class locally
Version: 0.x (alpha public release)
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.
To set up and configure the MultisiteMiddleware to achieve production-like domain routing locally:
-
Find your hosts file:
- For macOS/Linux -
/etc/hosts - For Windows -
C:\Windows\System32\drivers\etc\hosts
- For macOS/Linux -
-
Add the following to point a local domain to
127.0.0.1: -
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.localhostto theHostNamefield.
- Navigate to
This ensures consistency between your local development environment and the content served by SitecoreAI.
If you have suggestions for improving this article, let us know!