From c011114051474d344f5f85d6a91da296c2e03136 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Wed, 3 Feb 2010 09:04:51 +0000 Subject: [PATCH] htaccess for missing .html --- .htaccess | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..5eb6419 --- /dev/null +++ b/.htaccess @@ -0,0 +1,20 @@ + +Options +FollowSymLinks +ExecCGI +RewriteEngine On +RewriteBase / + +# no-www.org +RewriteCond %{HTTP_HOST} ^www\.html5demos\.com$ [NC,OR] +RewriteCond %{HTTP_HOST} ^www\.html5demo\.com$ [NC,OR] +RewriteCond %{HTTP_HOST} ^html5demo\.com$ [NC] +RewriteRule ^(.*)$ http://html5demos.com/$1 [R=301,L] + +# if the file or directory does exist +RewriteCond %{REQUEST_FILENAME} -d [OR] +RewriteCond %{REQUEST_FILENAME} -f +RewriteRule .* - [L] + +RewriteCond %{REQUEST_FILENAME}.html -f +RewriteRule (.*) $1.html [L] + +