Created
August 28, 2013 14:30
-
-
Save EpocSquadron/6366641 to your computer and use it in GitHub Desktop.
Htaccess snippet for forcing trailing slash at the end of urls.
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
# ------------------------------------------------------------------------------ | |
# | Suppressing / Forcing the "/" at the end of URLs | | |
# ------------------------------------------------------------------------------ | |
# Place this underneath the 'Suppressing / Forcing the "www."' | |
# section of the h5bp file, or just ensure it occurs before the | |
# index.php rewrite. | |
<IfModule mod_rewrite.c> | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !(.*)/$ | |
RewriteRule ^(.*)$ $1/ [R=301] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment