The combination of the baseUrlForSite
and siteForUrl
callbacks configures a site mapping for multi-site support. By configuring a site mapping, you enable Scrivito to differentiate between multiple sites by their individual site IDs and URLs. Scrivito uses this mapping to determine the site the browser is currently displaying, for example. It is also used for cross-site-navigation, i.e. to generate the appropriate URL when a link on the current site points to a page on a different site.