This was originally posted on 2011-07-11 to http://andrewho.co.uk/weblog/clean-urls-on-jekyll-apache
I use a static site generator, specifically [jekyll][], to transform some
templates into a set of static *.html
files. However, I like to keep the URLs
looking clean, and not display the .html
extension both because I think it
looks better and also so that the URLs purely reflect the content and not the
underlying files or CMS used to serve that content. In short, whilst the file
being served might be $DOCUMENT_ROOT/weblog/title.html
, the canonical URL for
that resource should be /weblog/title
. Here's how I do that in .htaccess
.