[pmwiki-users] clean URLs for wikifarm in subdirectory
Grorge J. De Bruin
gdb at soundchasers.com
Tue Mar 15 21:45:27 CST 2005
On Tue, 15 Mar 2005 17:23:00 -0600
"Patrick R. Michaud" <pmichaud at pobox.com> wrote:
> > Problem: several configuration things want
URLs, such as farmmap.txt
> > and config.php. Well, on the webserver they
start with
> > "http://arndis.godsong.org", and on my machine
they start with
> > "http://localhost". Changing them back and
forth is a nuisance. Is
> > there something I can do to tell these to use
the base URL plus
> > whatever, and to get the base URL from the
server? What file would I
> > put that information in?
>
> 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. In that case, the easiest thing to do is
to create special .php
> files that hold any machine-specific settings,
and include them from
> config.php. For example, in your
local/config.php you could put:
Actually, I just ran into this problem too -- and
I was looking for a possibly better solution -- or
one that is nearly as graceful as the above idea
taken a step further...
What is needed is a way to use something like
$BaseUrl in the actual pages that are are being
written. For example, look at one of the pages in
my Gallery section:
http://www.soundchasers.com/index.php?n=Gallery.CountrysideAnimals
For each row of images, I had to generate the
following PmWiki code:
|| [[AoC01 | The Ermine]] || [[AoC02 | The Great
Bat]] || [[AoC03 | The Frog]] ||
||
http://www.SoundChasers.com/uploads/Gallery/Animals_of_the_Countryside/thumb-Animals_of_the_Countryside_01a.jpg
||
http://www.SoundChasers.com/uploads/Gallery/Animals_of_the_Countryside/thumb-Animals_of_the_Countryside_02a.jpg
||
http://www.SoundChasers.com/uploads/Gallery/Animals_of_the_Countryside/thumb-Animals_of_the_Countryside_03a.jpg
||
This is fine for my hosting service where the
files are actually hosted for viewing online.
However, in the copy that I am keeping on my local
system, it means going out to the website and
pulling down the images over a slow phone line
connection, and messing with the usage of the
website (until the images are cached).
IMO -- it would be ideal if we could do something
like:
|| [[AoC01 | The Ermine]] || [[AoC02 | The Great
Bat]] || [[AoC03 | The Frog]] ||
||
{$BaseUrl}/uploads/Gallery/Animals_of_the_Countryside/thumb-Animals_of_the_Countryside_01a.jpg
||
{$BaseUrl}/uploads/Gallery/Animals_of_the_Countryside/thumb-Animals_of_the_Countryside_02a.jpg
||
{$BaseUrl}/uploads/Gallery/Animals_of_the_Countryside/thumb-Animals_of_the_Countryside_03a.jpg
||
To make things a little more complicated: I
couldn't figure out a way to get an image to link
to another wiki page. Personally, if it were
possible to do something like:
[[Gallery.AoC01 |
{$BaseUrl}/uploads/Gallery/Animals_of_the_Countryside/thumb-Animals_of_the_Countryside_01a.jpg]]
it would be extremely useful. But, I couldn't
figure out a way to do either of these... Is
there something that I am missing?
// George (Who's off to find a replacement for his
deceased laptop hard drive....)
// Using PmWiki 2.0, Beta 26
More information about the pmwiki-users
mailing list