Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Using Apaches mod_rewrite to access files in a different directory

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

Code

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.