View Single Post


Old
  Post #1 (permalink)   02-12-2017, 11:25 AM
danielpmc
HD Amateur
 
Join Date: Feb 2017
Posts: 82

Status: danielpmc is offline
You need to have a SSL certificate in place before using the shown codes. Place one or the other in your cPanel public_html/.htacces file. Important: any .htaccess file must start with a dot and the chmod (pernmissions) are ALWAYS set at 644

If the .htaccess file does not have the "RewriteEngine on" in the file, uncomment by removing the hashtag. This only needs to appear once in the .htaccess file as it will cover all other Rewrites present and future.
Replace example dot com with your domain name

This forces all http pages to No WWW https
Code:
#RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R,L]
This forces all http pages to WWW https
Code:
#RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
__________________
Stone soup is flavored by its offerings of humanity.