|Posted: Tue, 2003-11-11 17:38|
My web server sits behind an ADSL router/firewall, which means it has 2 hostnames; one for people accessing it from outside and one for local access on my LAN. This gave me a problem, as all the links (e.g. 'login') referred to the hostname set in $gallery->app->photoAlbumURL and $gallery->app->albumDirURL in config.php
This doesn't work in my set-up because the local hostname doesn't work from outside and the outside hostname doesn't work from inside.
I found two ways to fix this by changing the 2 variables mentioned. One way is to use $_SERVER["SERVER_NAME"] instead of a hard-coded hostname.
$gallery->app->photoAlbumURL = "http://" . $_SERVER["SERVER_NAME"] . "/gallery";
The other (simpler) way is not to have a hostname in these variables at all.
$gallery->app->photoAlbumURL = "/gallery";
Now all the links use the same hostname as the original request :P
IMHO there's no reason to have had the hostname in these variables; but there might be a reason I'm unaware of.