[Mediawiki-l] Setting wgServerName

Ben Bullock benkasminbullock at gmail.com
Thu Jun 15 01:50:20 UTC 2006


Um, following Brion's advice I upgraded to 1.6.7.

This reveals another problem. My URLs used to come out strangely, and
I was told by my web hosts to use $_SERVER['HTTP_HOST'] rather than
$_SERVER['SERVER_NAME'] for $wgServerName. But, to get that right, I
had to edit DefaultSettings.php.

Now, I know it says "Do not edit" at the top, and also
DefaultSettings.php is overwritten on upgrades, so this is not ideal.
After yet another upgrade to 1.6.7, I thought I'd put the line about
wgServerName into LocalSettings.php, but it doesn't work. Even if I
add the

$wgServerName = $_SERVER['HTTP_HOST'];

line right after the line "require includes/DefaultSettings.php", it
still gives the "wrong" URL of the site.

I know I'm not supposed to edit DefaultSettings.php, so what should I do?

Thanks for any advice etc.



More information about the MediaWiki-l mailing list