[BlueOnyx:26307] Re: HTTPS redirect

Ken Hohhof khohhof at kwom.com
Tue Jun 20 13:23:44 -05 2023


Many thanks, that fixed it.  The AllowOverride checkboxes are what I was missing.

-----Original Message-----
From: Blueonyx <blueonyx-bounces at mail.blueonyx.it> On Behalf Of Michael Stauber via Blueonyx
Sent: Tuesday, June 20, 2023 12:42 PM
To: blueonyx at mail.blueonyx.it
Subject: [BlueOnyx:26305] Re: HTTPS redirect

Hi Ken,

> I’m embarrassed to ask about an old 5208R system we have, obviously it 
> is seriously out of date.  So if you ignore me or yell at me, I will 
> understand.

Nah, no yelling. It's high time to upgrade, but we all know how it goes. :o)

> I don’t particularly care what happens when someone types the IP 
> address as the URL, but if they type www.domain.com, I’d like them to 
> get https://www.domain.com just like when they type domain.com.

Yeah, with shared hosting the thing is that when someone goes to the IP and there are multiple Vsites on it? They land on the first VirtualHost that's configured in Apache for that IP.

For domain name redirects from HTTP to HTTPS a .htaccess is usually the simplest option.

However, usage of .htaccess files is not allowed by default in Vsites by default, as they can be used to reconfigure Apache and sometimes we might not want that siteAdmins can do that.

So first go to "Server Management" / "Network Services" / "Web" and make sure that under the grey heading "Options:" you have all checkboxes ticked. You can leave "MultiViews" and "SymLinksIfOwnerMatch" unchecked. 
Under "AllowOverride:" tick all checkboxes.

Then create a .htaccess in the /web directory of your Vsite and put the following three lines into it:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

That should do it.

--
With best regards

Michael Stauber
_______________________________________________
Blueonyx mailing list
Blueonyx at mail.blueonyx.it
http://mail.blueonyx.it/mailman/listinfo/blueonyx






More information about the Blueonyx mailing list