/ Published in: Apache
                    
                                        
This .htaccess actually forces all traffic to https, and allows cakephp app to work properly, as well as letsencrypt to go thru
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^.well-known/ - [L,NC]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
URL: https://stackoverflow.com/questions/38790421/letsencrypt-with-htaccess/41391957#41391957
Comments
 Subscribe to comments
                    Subscribe to comments
                
                