-
Notifications
You must be signed in to change notification settings - Fork 10
HTTPS
Matej Jellus edited this page Oct 9, 2019
·
1 revision
Links:
For some project I am using slim and it has its index.php
in the root path of the project, which is not a good practice. Mostly you want to have it in some public
directory. To accomplish this and in the same time solve http -> https redirect problem, I am using this:
# /.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]
</IfModule>
CSS
HTML
Image
JavaScript