[eluser]Xeoncross[/eluser]
I have been forcing trailing slashes into all my paths since starting with CI. For example:
Code:
site.com/
site.com/welcome/
site.com/profile/
Thanks to some nice mod_rewriting:
Code:
# Forces trailing slashes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.+)$ $1/ [L,R=301]
However, given the old adage that "directories end in slashes, while files don't" I started questioning my method. After all site.com/profile/ isn't a directory - it's a page. So I am now changing to removing ending slashes from all my pages.
Code:
# Removes trailing slashes
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} /$
RewriteRule ^(.+)/$ $1 [L,R=301]
Any input on which one is the proper method? I really would like to pick one and stick with it.