[pmwiki-users] host-independent URLs for configurations

Bronwyn Boltwood arndis at gmail.com
Tue Mar 15 21:57:11 CST 2005


On Tue, 15 Mar 2005 17:23:00 -0600, Patrick R. Michaud
<pmichaud at pobox.com> wrote:
> Well, in general you can get the base server URL by doing the
> following:
> 
>    $BaseUrl = 'http://' . $_SERVER['HTTP_HOST'];
> 
> However, I'm guessing there must be some reason this doesn't work for
> you.

I'm testing on the local copy, and while $BaseUrl is working nicely
for most things, it doesn't in farmmap.txt.  e.g.
http://localhost/portfolio/Portfolio/$BaseUrl/static/rg/rg1.html,
where 'http://localhost/portfolio/Portfolio/' is coming from I'm not
sure what, '$BaseUrl/static/' from farmmap.txt, and 'rg/rg1.html' from
me.

I have a feeling that that is to be expected.  Am I right?  I'll just
add the map file per machine instead; that's only a minor nuisance.

The $BaseUrl trick is worth documenting, for two reasons: 
1. I didn't know creating a variable was that easy.
2. The stuff on the other side is gobbledegook to me, though I can
guess that it means "yo, Apache! what's the server name here?".  I
wouldn't have known where to go to find it.

So, it'd probably be useful for some other people too.

Bronwyn



More information about the pmwiki-users mailing list