301 instead of 302 redirects for HTTPS


It would be very nice if users could be given the option to have Virtualmin set up 301 (Moved Permanently) redirects instead of 302 (Found) redirects in two cases: when manually adding redirects via Server Configuration > Website Redirects, and when Virtualmin sets them up automatically after enabling SSL support and assigning a Let's Encrypt certificate.

According to the following article, 301 redirects are much better for SEO purposes than 302 redirects. Is there a way this option can be implemented in a future release of Virtualmin?

Here is the article in question: https://moz.com/learn/seo/redirection


Closed (fixed)


i am also wondering if we can have an option which does the redirect from http to https when there will a https website config is created by selection of that option in virtualmin.


PS: if i want to create a letsencrypt cert for webmin, i would have to tell him to use /var/www/html for verification, when i have virtualmin installed. Should be a standard settin in that context. But just running cloudmin and webmin, will keep me from using webroot for validation, there i would appreciate another standard setting for being able to use a cert for that domain too...

You can setup http to https redirects in Virtualmin, at Server Configuration -> Website Redirects.

Happy Easter! The problem with the current Website Redirects feature in the Server Configuration menu is that it sets up HTTP 302 redirects instead of the more SEO friendly HTTP 301. Is there any way to change this behavior?


Right now, no .. other than editing the Apache config file directly.

I'm skeptical that it makes a difference though.

Hi Jamie,

Could you perhaps elaborate more on the reasons for your skepticism? Also, did you have a chance to read the SEO article I linked to in my original post which discusses HTTP 301 redirects? Thanks!

Yes, I read that article - it seemed to be mostly speculation than any hard evidence.

What about having a global variable for this in virtualmin? if you have more than a couple of websites this is tedious, having to set this one in each virtual server Best

That maybe possible ... I'll update this ticket with progress.

The next Virtualmin release will allow the HTTP status code to be customized when creating a redirect.

Status: Fixed ยป Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.