Created
December 17, 2014 22:38
-
-
Save evemilano/6756d25babae51287438 to your computer and use it in GitHub Desktop.
Aggiungere lo slash alla fine di tutti gli URL
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
RewriteEngine on | |
# Ensure all directory URLs have a trailing slash. | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} !\/$ | |
RewriteCond %{REQUEST_URI} !\/[^\/]*\.[^\/]+$ | |
RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI}/ [L,R=301] | |
# Same for HTTPS: | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} !\/$ | |
RewriteCond %{REQUEST_URI} !\/[^\/]*\.[^\/]+$ | |
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}/ [L,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.evemilano.com/2014/12/redirezioni-e-comandi-utili-per-il-file-htaccess/