Control Web Panel
WebPanel => Information => Topic started by: martexx on February 24, 2017, 01:41:33 PM
-
In 2017 someone may require secure connections as its good, and especially for SEO
There is now visual way to achieve this in cwp
lets asume u use apache
disable any redirect u may have right now as they will interfere with the lets encrypt module
so in vhost.conf or .htaccess remove any redirects
But only for the domain u dont use or want to change
delete the folders in
/etc/letsencrypt/live
/etc/letsencrypt/archive
/etc/letsencrypt/renewal
Then via the cwp gui create the certificates again with the www alias checked
Now add in /usr/local/apache/conf.d/vhosts-ssl-letsencrypt.conf (per domain)
or in .htaccess in webroot of domain (per domain)
Or add
RewriteOptions InheritDown
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
to httpd.conf (then all domains will redirect to https://www.
-
it worked for me, add in .htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://example.org/$1 [L,R=301,NC]
-
There are too many ways for the redirect.
Try gooling by "redirect non-ww to www .htaccess" ;)
-
No need of any manual configuration. If you are using nginx->apache as web server, just use the "force https" nginx template in your web server settings.
-
None of my domains are automatically forwarding to https like they did before. Whats going on?
-
None of my domains are automatically forwarding to https like they did before. Whats going on?
maybe you have changed apache to nginx which do not understand .htaccess?