[pmwiki-users] URL/host based configuration

Oliver Betz list_ob at gmx.net
Mon Nov 14 12:12:35 CST 2011


Rogut?s Sparnuotos wrote:

>You want the same content on different domains, with some specific
>settings per domain?

I don't know whether Simon really wants to do what I described in the
original posting, but I want to do so.

It's pretty simple:

if(preg_match("/foo.invalid$/", $_SERVER['HTTP_HOST'])) {
  $DefaultGroup = 'Foo';
  $SearchPatterns['default'][] = '!^(Bar|Other)\\.!';
}

This sets a different start group if PmWiki is reached via the
foo.invalid domain, and blocks certain groups to be found by the
standard search.

Of course, the sidebar should be changed, too.

This doesn't block access to the "other" pages, but they are hidden
from the normal visitor.

BTW: HTTP_HOST seems to be the better choice, because it's based on
the request, while SERVER_NAME can be different if an alias is set.

Oliver
-- 
Oliver Betz, Muenchen (oliverbetz.de)




More information about the pmwiki-users mailing list