Using Apaches mod_rewrite to access files in a different directory

August - 2012

I like clean URLs. Nothing more than:

http://example.com/page-name

This is part of how I set that up when I was using apache via mod_rewrite

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/pages/$1.html  -f
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/pages/$1.html [L]

TODO: Add more details on exactly what this is doing.