Created
January 6, 2018 22:14
-
-
Save miroslav-mrazek/356dd394efc3e52ccba03fd4c654b911 to your computer and use it in GitHub Desktop.
Přesměrování na https v Nette 2.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # root .htaccess | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteRule ^$ www/ [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteCond %{REQUEST_URI} !^www/ | |
| RewriteRule ^(.*)$ www/$1 | |
| </IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # www/.htaccess | |
| # disable directory listing | |
| <IfModule mod_autoindex.c> | |
| Options -Indexes | |
| </IfModule> | |
| # enable cool URL | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| # RewriteBase / | |
| # prevents files starting with dot to be viewed by browser | |
| RewriteRule /\.|^\. - [F] | |
| # front controller | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule !\.(pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ index.php [L] | |
| # use https protocol | |
| RewriteCond %{HTTPS} off | |
| RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
| </IfModule> | |
| # enable gzip compression | |
| <IfModule mod_deflate.c> | |
| AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/json | |
| </IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment