|
Cookbook /
UseAlternativeConfigurationsSummary: Get the base URL from the server
Version:
Prerequisites: Last tested on PmWiki version: 2.0 beta26
Status:
Maintainer:
Categories: Administration
QuestionIs there something I can do to get the base URL from the server? AnswerHere's what I do. Hackish, I know, but it works: Inside local/config.php, before any $...Url variables are declared
if(($sn=$_SERVER['SERVER_NAME'])=='127.0.0.1'){
...stuff for the config locally...
}else{
...stuff for config somewhere else...
}
The $sn variable I use inside both configs as a domain name for urls, like:
Instead of 127.0.0.1 you can use:
Notes and CommentsSee AlsoContributors-Radu March 15, 2005, at 03:35 PM |