h5bp/html5-boilerplate — Issue #874:  .htaccess mod_rewrite Directory File extensions
Author: grayghostvisuals
Created: 2011-12-03 01:56:45+00:00
State: open

I thought since the HTML5 Boilerplate contains a custom .htaccess file
-and by default encourages sexier shorter URL's - why not include a
mod_rewrite that would allow files to be referenced by their file name
( minus the files extension) by default.

Of course write it in a way that strips all file extensions globally
without a specific extension reference in the rewrite rules and
conditions.

#
----------------------------------------------------------------------
# Allow site files to be written with no file extension present in the
URL string
#
----------------------------------------------------------------------

# Instead of your sites files as this => domain-name.com/file.php
# Rewrite so users can do this instead => domain-name.com/file

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [L]