Return to Snippet

Revision: 72735
at November 23, 2017 18:17 by acosonic

Initial Code
<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]

Initial URL

Initial Description
This .htaccess actually forces all traffic to https, and allows cakephp app to work properly, as well as letsencrypt to go thru

Initial Title
Htaccess rewrite file for Letsencrypt and CakePHP app

Initial Tags
cakephp, htaccess

Initial Language