[Pmwiki-users] Single wiki, multiple hostnames; restricting group access based on hostname
Niall Durham
niall_durham
Thu Jan 22 21:19:27 CST 2004
Hello,
On our shared hosting server we have it setup where a single PmWiki
installation powers several different PmWiki groups tied to different
hostnames. E.g.,
http://www.going-coastal.com
http://www.thunderdata1.com
There are several benefits to this setup. However, one drawback is
that one can access another group (another site, usually) from the
"incorrect" host:
http://www.thunderdata1.com/wiki/GC/About
Since the graphics and stylesheet are stored under the
going-coastal.com host, the page is not rendered properly (as you can
plainly see). Some of the web crawlers even index sites under the
wrong hostname:
http://www.google.com/search?q=going-coastal+escalante
The best solution I have come up with (I'm planning on coding it up
tomorrow/next week) is to make a script that contains a mapping of
PmWiki groups to (correct) hostnames. E.g. (pseudo markup),
"GC" => "going-coastal.com",
"TDS" => "thunderdata1.com",
...
This script will check the REQUEST_URI to make sure the group and
hostname match. If they don't, it will reformat the request with the
proper hostname and return a 301 w/ the corrected URL.
We want something that's easy to maintain as we add more sites and
allows pre-existing incorrect hostname URLs will still work. With
this approach, we only have to add one line to this "group ->
hostname" script for each new site/group we add, and add an
include_once() line to each customized group script.
So... The reason I'm spamming everyone is to see if someone has
already solved this problem and/or has a better solution/idea than
I'm planning to implement.
Thanks for reading this far,
Niall
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
More information about the pmwiki-users
mailing list