SetEnv DEFAULT_PHP_VERSION 5 ErrorDocument 404 /http-404 ErrorDocument 410 /http-410 FileETag MTime Size RewriteEngine on # no-www.org RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] # enable strict error warning to trap lazy code php_flag display_errors On php_value error_reporting 6143 # do not mess with these directories RewriteRule ^(_.*)/ - [NC,L] # force utf-8 for a number of file formats AddDefaultCharset utf-8 AddCharset utf-8 .xhtml .css .csz .rsz # allow you guys to see this file allow from all # compressed CSS # --------------------------------------------------------------------------------------------------------------------------- # "csz" compressed CSS filetype AddType text/css .csz AddEncoding gzip .csz # on my localhost, don't use a cached CSS file RewriteCond %{DOCUMENT_ROOT} "^/Users/kroc/Sites/Camen Design/upload" RewriteRule ^design/$ /design/design.css [L] RewriteRule ^design/$ /design/design.csz [L] # compressed RSS # --------------------------------------------------------------------------------------------------------------------------- AddType application/rss+xml .rsz AddEncoding gzip .rsz # a couple of fixes for changes to RSS made during development # (to be removed in a month) RewriteRule ^rsz$ /rss [R=301] RewriteRule ^rss/([a-z0-9-]+)$ /$1/rss [R=301] # give the compressed RSS file for the given directory RewriteRule ^([a-z0-9-]+/)?rss$ /$1rss.rsz [L] # main content # --------------------------------------------------------------------------------------------------------------------------- # PHP source RewriteRule ^php$ /code/files/0.2/publish.php # .xhtml files are gzipped html5 documents ready to serve AddType application/xhtml+xml .xhtml AddEncoding gzip .xhtml # load page 1 by deafult DirectoryIndex 1.xhtml index.php index.html index.cgi # these are insane hacks to please IE by forcing the above line # (I think this caused by an earlier version of Apache on my live server, or some other configuration difference) RewriteRule ^$ /1.xhtml RewriteRule ^([^/]*)/$ /$1/1.xhtml # leave the ".xhtml" off (clean urls) RewriteRule ^([^\.]*[^/])$ /$1.xhtml [PT] # if the url contains the ".xhtml", show the source code RewriteCond %{THE_REQUEST} \b([^\.]*[^/])\.xhtml\b RewriteRule ^ - [T=text/plain,L] # although I don't support IE, I do have to fall back to text/html, # otherwise it will try and download the page instead of rendering it RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml RewriteCond %{REQUEST_FILENAME} .*\.xhtml RewriteRule ^ - [T=text/html,L] # legacy # --------------------------------------------------------------------------------------------------------------------------- # the enclosures have moved. nobody should be hotlinking these RewriteRule ^data/content-media/([a-z0-9-]+)/(.+)$ /$1/files/$2 [R=301,NC,L] # redirect the old source code pages to the archive RewriteRule ^code/(code|content|database|shared)\.php /code/files/0.1/$1.php [R=301,L] # redirect old ".asp" links to the homepage RewriteCond %{QUERY_STRING} . RewriteRule ^.*.asp(\?.*)?$ /? [R=301,L] # tannerhelland.com used to be hosted here RewriteRule ^System/RSS/TannerHelland/(News|MusicReleases).xml$ http://www.thehellands.com/THIS/feed/ [R=301,NC,L] RewriteRule ^TannerHelland/.*$ http://thehellands.com/THIS/ [R=301,NC,L] # theraje.com was temporarily in a subfolder, now in a subdomain RewriteRule ^(?:theraje.php)$ http://theraje.camendesign.com [R=301,NC,L] # put any querystring through index.php (legacy v0.1 url redirector) RewriteCond %{QUERY_STRING} .+ RewriteRule ^ index.php [L]