Forums / Setup & design / Combining uri and host i matchorder

Combining uri and host i matchorder

Author Message

Mads Ovesen

Tuesday 09 October 2007 7:32:22 am

Does anybody have experience in combining host and uri in siteaccesses? In the documentation under site.ini it is stated that the MatchOrder variable can take several matching types:

MatchOrder= match_type1[; match_type2]...

Lets imagine we want the following 3 siteaccess:
1) testsite.no (siteacces=test (host))
2) admin.testsite.no (siteaccess=admin (host))
3) testsite.no/front (siteacces=test (uri))

In the site.ini the following should be:

MatchOrder=uri;host
HostMatchType=map
HostMatchMapItems[]=testsite.no;test
HostMatchMapItems[]=admin.testsite.no;test
URIMatchType=map
URIMatchMapItems[]=front;test

Here are my thoughts:
uri must come before host, because in the last case (3) it must match the uri before the host. In all other cases there is no uri to match, so it must fall back to host. When I look at the function AccessType in access.php it iterates over the different matchorders. But if uri is the first element in this iteration (as in the example) it will always return with this siteaccess. It will return either in the switch statement in line 119 or after the switch statement in line 261 or line 266. In other words, the above example will never work. Is this a bug or did I misunderstand something?

/m

Mads Ovesen

Saturday 13 October 2007 5:56:02 am

I will report this as a bug then...

/m