Message-ID: <637847278.2544.1485845397843.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2543_40045764.1485845397843" ------=_Part_2543_40045764.1485845397843 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Siteaccess

Siteaccess

eZ Platform allows you to maintain multiple sites in one install= ation using a feature called siteaccesses.

In short, a siteaccess is a set of configuration settings that is used w= hen the site is reached through a specific address.

When the user accesses the site, the system analyzes the uri and compare= s it to rules specified in the configuration. If it finds a set of fitting = rules, this siteaccess is used.

 

What does a siteaccess do?

A siteaccess overrides the default configuration. This means that if the= siteaccess does not specify some aspect of the configuration, the default = values will be used. The default configuration is also used when no siteacc= ess can be matched to a situation.

A siteaccess can decide many things about the website, for example the d= atabase, language or var directory that are used.

 

How is a siteaccess selecte= d?

A siteaccess is selected using one or more matchers =E2=80=93 rules base= d on the uri or its parts. Example matching criteria are elements of the ur= i, host name (or its parts), port number, etc.

For detailed information on how siteaccess matchers work, see Siteaccess Matching.

 

What can you use siteac= cesses for?

Typical uses of a siteaccess are:

 

Both the rules for siteaccess matching and its effects are located in th= e main app/config/ezplatform.yml configuration file.

 

Use case: multilanguage si= tes

A site has content in two languages: English and Norwegian. It has one U= RI per language: http://example.com/eng and http://example.com/= n or. Uri parts of each language (eng, nor) are mapped to a <= em>siteaccess, commonly named like the uri part: eng, nor. Using semantic configurati= on, each of these siteaccesses can be assigned a prioritized list of langua= ges it should display:

Such configuration would look like this:

=20
ezpublish:
=09siteaccess:
=09=09# There are two siteaccess
=09=09list: [eng, nor]
 
=09=09# eng is the default one if no prefix is specified
        default_siteaccess: eng

=09=09# the first URI of the element is used to find a siteaccess with a si=
milar name
        match:
=09=09    URIElement: 1


ezpublish:
=09# root node for configuration per siteaccess=20
=09system:
=09=09# Configuration for the 'eng' siteaccess
        eng:
=09=09=09languages: [eng-GB]
        nor:
            languages: [nor-NO, eng-GB]
=20

The default scope

When no particular context is required, it is fine to use the `default` = scope instead of specifying a siteaccess.

 

Related topics:
------=_Part_2543_40045764.1485845397843--