Bug: The option "Redirect all requests to SSL site?" uses 302 Redirect

The option under “Virtualmin” : “Server Configuration” : “Website Options” > “Redirect all requests to SSL site?” is adding the wrong type of redirect.

The above option adds a 302 redirect because Virtualmin hasn’t specified a 301 redirect, this means Google etc… treats the redirect as temporary when this option is set. SEO wise this isn’t ideal for sites which are moving from http to https or where there’s a lot of backlinks to the http version of the site. This option should add a 301 redirect.

Use this header checking tool https://varvy.com/tools/redirects/ which gives an easy to understand output on these 2 domains (both on the same Virtualmin server):

https://general-election-2010.co.uk/ “Redirect all requests to SSL site?” setting ON
https://seo-gold.com/ “Redirect all requests to SSL site?” setting OFF

You will see the election URL shows a 302 redirect of port 80 traffic, whilst the SEO URL shows a 301 redirect (I’ve got a 301 redirect within that sites .htaccess file).

The problem code is:

RedirectMatch ^/(?!.well-known)(.*)$ https://general-election-2010.co.uk/$1

Because it lacks a type of redirect it defaults to a 302 redirect, so the code should be:

RedirectMatch permanent ^/(?!.well-known)(.*)$ https://general-election-2010.co.uk/$1

I’ll be fixing the election site redirect tomorrow.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.