Topic on Project:Support desk/Flow

Changing $wgServer value in a running website

6
Summary by Biologically

Very helpful answers with two different ways to properly configure a website after installing SSL/TLS.

Biologically (talkcontribs)

Due to adding SSL my website URL now https

Should I change the SwgServer = "http://example.com" to $wgServer = "https://example.com" ?

As the website is active, would changing it will break the site? Will it cause errors?

Just a related question, if I change the value to $wgServer = "https://www.example.com" would it cause errors or break the site?

AhmadF.Cheema (talkcontribs)

After setting-up SSL for you domain, you should change the $wgServer to https, otherwise there will be some errors and you might not be able to use some features such as Extension:AbuseFilter.

Doing such will not break the site.

Biologically (talkcontribs)

Thank you so much.

星耀晨曦 (talkcontribs)

Or use //example.com, this is used for supporting both HTTP and HTTPS with the same caches by using links that work under both protocols. But I do not know what is the difference between this and https.

Bawolff (talkcontribs)

If you want to use both http and https, then you can set

$wgServer = '//example.com';
$wgCanonicalServer = 'https://example.com';

But, if you really want best security, you should support only HTTPS (make http version redirect to http in apaches, and set HSTS header in apache), in which case you want $wgServer = 'https://example.com'; to tell MediaWiki that only https is supported and http is not supported.

Biologically (talkcontribs)

Thank you. Really helpful advice.