Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

HostMatchType

Summary

Sets which type of host matching to use to select the siteaccess.

Usage

 

HostMatchType=disabled|map|element|text|regexp

Description

Use host match when you want to select the siteaccess based on the host part of the URL. Host matching can be used in four different modes or be disabled completely. The available options are:

  • disabled - Disables host matching. If host matching is specified in the MatchOrder setting it will be ignored.
  • map - Select the siteaccess based on the complete hostname. Specify the mapping between a hostname and the siteaccess to use with the HostMatchMapItems setting.
  • element - The siteaccess is specified by a one of the subdomains that are part of the hostname. Select which part of the hostname (separated by dots) that specifies the siteaccess with the HostMatchElement setting.
  • text - The siteaccess is given by some arbitrary part of the hostname with a fixed pre and post text. Set the pre and post text with the HostMatchSubtextPre and HostMatchSubtextPost settings.
  • regexp - Use a regular expression to obtain the siteaccess name from the hostname. Set the regular expression and the submatch to use with the HostMatchRegexp and HostMatchRegexpItem settings.

Examples

Map matching

HostMatchType=map
HostMatchMapItems[]=mydomain.no;user
HostMatchMapItems[]=admin.mydomain.no;admin

This configuration uses the map hostmatching type. If the site is acccessed using the domain mydomain.no the siteaccess named user is used. If the domain admin.mydomain.no is used the admin siteaccess is used instead.

Element matching

HostMatchType=element
HostMatchElement=1

This configuration uses the second element in the hostname as siteaccess using element matching. For example the hostname first.second.third.com yields the siteaccess second.

Text matching

HostMatchType=text
HostMatchSubtextPre=my
HostMatchSubtextPost=site.ez.no

This text mathcing configuration uses everything between my and site.ez.no as the siteaccess. E.g myadminsite.ez.no would produce the siteaccess admin. The hostname myusersite.ez.no produces the siteaccessname user.

Regexp matching

HostMatchType=regexp
HostMatchRegexp=^(.+)\.example\.com
HostMatchRegexpItem=1

This regexp setup uses the regular expression ^(.+)\.example\.com to match anything in front of .example.com. The first match is set up to hold the siteaccess. E.g the hostname test.example.com yields the siteaccess test.

Frederik Holljen (31/03/2005 2:15 pm)

Frederik Holljen (31/03/2005 2:50 pm)


Comments

  • can i use two matching types?

    i have 100 sites XXX.site.com related with siteacess the same as XXX part.
    But there is several exceptions: admin.site.com related with access "forum_admin", and xxxxx.com related site access "aaaa"

    Can i use map for exceptions, and regexp for the rest?
    • Re: can i use two matching types?

      I seems, that it is not posssible. But, after some modifications of acess.php http://issues.ez.no/IssueView.php?Id=9387& , it became possible...