Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-16706

New MatchOrder - host_pri_uri

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Medium Medium
    • None
    • 4.3.0
    • Misc
    • None

    Description

      I've created a new MatchOrder called host_pri_uri.

      The idea of this matching type, is to specify a hostname, the basename of the siteaccess, and then a list of available postfix elements for the siteaccess.

      Two new config vars are also added:

      HostPriUriMatchAllowPartialHost=true
      HostPriUriMatchSeparator=_
      

      *Example*

      HostPriUriMatchMapItems[ez.no]=ez;no;en;admin
      

      *How is it matched?*
      The hostname is placed as a key, to be able to have all the rules in one line (which is nice when you have a ton of hostnames to match).

      Basically, how this works, is that it'll first check if the hostname matches the rule.
      If it does, it'll use the first element (that's where the pri/priority name comes from) in the list as the basename of the siteaccess.
      Then it checks if there's something in the uri. If there's nothing present, or if it doesn't match any of the remaining postfix elements, it'll use the first element as default.

      This means that it'll get translated like this (uri => siteaccess):
      ez.no => ez_no
      ez.no/no => ez_no
      ez.no/en => ez_en
      ez.no/admin => ez_admin

      *HostPriUriMatchSeparator*
      This allows you to override how the basename and the postfix is concatenated

      *HostPriUriMatchAllowPartialHost*
      Set this to true to use string positioning instead of equality matching to match the hostname.
      This is to make it easier to have different environments, and still use the same matching rules.
      This means that *ez.no.development.hostname.com* can be matched equally as *ez.no*

      Thanks to Felix Woldt for inspiring this idea. Check out his original host_uri proposal at http://issues.ez.no/IssueView.php?Id=15359&

      Attachments

        Activity

          People

            unknown unknown
            rudolfrck rudolfrck
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: