Skip to content

Instantly share code, notes, and snippets.

@gcarrion-gfrmedia
Created May 24, 2012 20:30
Show Gist options
  • Save gcarrion-gfrmedia/2784020 to your computer and use it in GitHub Desktop.
Save gcarrion-gfrmedia/2784020 to your computer and use it in GitHub Desktop.
Add a trailing slash to requested urls
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !example.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://domain.com/$1/ [L,R=301]
# Source: http://enarion.net/web/htaccess/trailing-slash/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment