bba73143f4b1

Www is evil.  Kill it with mod_rewrite.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sat, 23 Jan 2010 14:17:09 -0500
parents 310bcfd9183d
children 7c5b03eaf0cd
branches/tags (none)
files content/.htaccess

Changes

--- a/content/.htaccess	Fri Jan 22 20:12:59 2010 -0500
+++ b/content/.htaccess	Sat Jan 23 14:17:09 2010 -0500
@@ -1,7 +1,10 @@
-{% if GENERATE_CLEAN_URLS %}
 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]
@@ -16,6 +19,4 @@
 RewriteCond %{REQUEST_FILENAME}.html -f
 RewriteRule ^.*$ %{REQUEST_FILENAME}.html
 
-{% endif %}
-
 ErrorDocument 404 /404.html
\ No newline at end of file