Created
May 19, 2015 07:50
-
-
Save hmngwy/930b7dcd34b285f32698 to your computer and use it in GitHub Desktop.
Force trailing slashes in Apache
This file contains 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
RewriteCond %{HTTPS} =on | |
RewriteRule ^(.*)$ - [env=proto:https] | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.*)$ - [env=proto:http] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !(.*)/$ | |
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpg|png|jpeg|css|js)$ [NC] | |
RewriteRule ^(.*)$ %{ENV:proto}://%{HTTP_HOST}/$1/ [L,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment