From 28e5c31273051174452dcc1be343ea10dd7eb8f6 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Tue, 28 Apr 2020 17:50:41 -0400 Subject: [PATCH 1/1] move bandali.eu.org-specific bits of .htaccess to caffeine here we just take care of redirecting csclub.uwaterloo.ca/~abandali/ to bandali.eu.org --- static/.htaccess | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/static/.htaccess b/static/.htaccess index 96c757e..4f38f87 100644 --- a/static/.htaccess +++ b/static/.htaccess @@ -1,9 +1,15 @@ -# www -> no-www +# don't add .html in the rewrite below +Options -MultiViews + RewriteEngine On -RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] -RewriteRule ^ %{REQUEST_SCHEME}://%1%{REQUEST_URI} [R,L] - +RewriteBase / +# if not already on bandali.eu.org, redirect to there +RewriteCond %{HTTP_HOST} !^bandali\.eu\.org$ +RewriteRule ^(.*)$ https://bandali.eu.org/$1 [R] -# custom 404 page -ErrorDocument 404 /404.html +# now we have to explicitly tell apache that files with no +# extension are actually .html +RewriteCond %{REQUEST_FILENAME}.html -f +RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [L] + -- 2.20.1