Skip to content

Instantly share code, notes, and snippets.

@lukebussey
Created July 30, 2015 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukebussey/92d8531f7a19f3622e1b to your computer and use it in GitHub Desktop.
Save lukebussey/92d8531f7a19f3622e1b to your computer and use it in GitHub Desktop.
# ----------------------------------------------------------------------
# | Trailing Slash Fix |
# ----------------------------------------------------------------------
# Fixes the issue where mod_dir would issue a full redirect with the
# incorrect hostname when missing a trailing slash on a directory.
DirectorySlash Off
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*[^/])$ /$1/ [R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment