Skip to content

Instantly share code, notes, and snippets.

@alexroper
Created July 24, 2014 20:27
Show Gist options
  • Save alexroper/4f6036a70c072efd19de to your computer and use it in GitHub Desktop.
Save alexroper/4f6036a70c072efd19de to your computer and use it in GitHub Desktop.
Force training slash in URL with .htaccess
# Force training slash in URL
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment