Control Web Panel

WebPanel => CentOS-WebPanel GUI => Topic started by: licode on December 13, 2022, 11:50:50 AM

Title: How can I enable force HTTPS for Apache webserver for all domains?
Post by: licode on December 13, 2022, 11:50:50 AM
I tried searching and looking around and found nothing for Apache.
How can I resolve this without htaccess files.
Title: Re: How can I enable force HTTPS for Apache webserver for all domains?
Post by: PakPos on December 13, 2022, 07:17:23 PM
webserver--> mainconfig ?
Title: Re: How can I enable force HTTPS for Apache webserver for all domains?
Post by: licode on December 14, 2022, 12:55:08 PM
webserver--> mainconfig ?

Nope, nothing related to https or force https there.
Title: Re: How can I enable force HTTPS for Apache webserver for all domains?
Post by: PakPos on December 17, 2022, 04:37:21 AM
webserver--> mainconfig ?

Nope, nothing related to https or force https there.


goodluck then
Title: Re: How can I enable force HTTPS for Apache webserver for all domains?
Post by: overseer on February 10, 2023, 07:31:37 AM
It's possible to do a permanent redirect in the vhost config:
Code: [Select]
<VirtualHost *:80>
  ServerName example.com
  ServerAlias www.example.com

  Redirect permanent / https://example.com/
</VirtualHost>

But a 301 redirect is preferred. In vhost conf or in .htaccess:
Code: [Select]
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]