content/.htaccess @ bba73143f4b1

Www is evil.  Kill it with mod_rewrite.
author Steve Losh <steve@stevelosh.com>
date Sat, 23 Jan 2010 14:17:09 -0500
parents 0b8539e28640
children 1ce08f2b3085
RewriteEngine on
RewriteBase {{ node.site.settings.SITE_ROOT }}

# www is evil and must be abolished
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Old URLs
RewriteRule ^blog/entry/(\d+)/(\d\d)/\d+/([^/]*)/?$ /blog/$1/$2/$3/ [R=301,L]
RewriteRule ^blog/entry/(\d+)/(\d)/\d+/([^/]*)/?$ /blog/$1/0$2/$3/ [R=301,L]

{% hyde_listing_page_rewrite_rules %}

# listing pages whose names are the same as their enclosing folder's
RewriteCond %{REQUEST_FILENAME}/$1.html -f
RewriteRule ^([^/]*)/$ %{REQUEST_FILENAME}/$1.html

# regular pages
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^.*$ %{REQUEST_FILENAME}.html

ErrorDocument 404 /404.html