A siteaccess is a named entry point into one installation: a public site, an administration, a second language, a test host. Each siteaccess has its own settings in settings/siteaccess/<name>/, its own design and its own languages. For every request, Exponential first decides which siteaccess answers.
The match order
site.ini [SiteAccessSettings] MatchOrder lists the ways that are tried, in order. The shipped value is uri;host;port. The possible entries are host, host_uri, uri, port and servervar. When nothing matches, [SiteSettings] DefaultAccess answers.
By path
URIMatchType=element with URIMatchElement=1 (the shipped default) takes the first path segment as the siteaccess name, so /admin/... reaches the siteaccess admin. Other types are map (URIMatchMapItems[]=uri;siteaccess), text and regexp.
By host
HostMatchType=map with entries HostMatchMapItems[]=host;siteaccess. Since 6.0.15 an entry can name a third field, the matching method, and HostMatchMethod sets the default for all entries:
- strict: the host is the listed host (the default).
- start: the host begins with it, so www.example.com.test.local reaches the siteaccess of www.example.com.
- end: the host ends with it.
- part: the host contains it.
Every method compares host names as DNS does: without regard to case or a trailing dot, without the port of the request unless the entry names one, and a name written in Unicode as the ASCII form a browser sends (when PHP has intl). start and part also take hosts you did not mean, so use them only where the web server answers for your own hosts. The static cache knows only strict.
Lists you maintain
- AvailableSiteAccessList[]: the siteaccesses of the installation.
- RelatedSiteAccessList[]: the siteaccesses that share the same database. Cronjob pages, preloading and previews choose from it.
- RemoveSiteAccessIfDefaultAccess: leave the name of the default siteaccess out of links.
Sending visitors to their language
When no probe matches and the default siteaccess would answer, DefaultHostUriMatchMapItems[] can name the siteaccess and language segment instead, chosen by host and by the browser's Accept-Language. The start page / then redirects once (302) to, for example, /ger, with the address and query kept. DefaultHostUriRedirect=disabled shows the page at the address itself. Without these settings nothing changes.
After any change: php bin/php/ezcache.php --clear-tag=ini. More: Languages and translations and Several sites on one installation.