X-Git-Url: https://git.shemshak.org/~bandali/bndl.org/blobdiff_plain/b791db4e54041eef85f573d7cac5aec9325a6379..9b0e83daebf9e9ecda0f071bf51a9317f6d6384e:/static/.htaccess?ds=inline 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] +