From b791db4e54041eef85f573d7cac5aec9325a6379 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Tue, 21 Apr 2020 00:26:28 -0400 Subject: [PATCH] add .htaccess --- Makefile | 2 +- static/.htaccess | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 static/.htaccess diff --git a/Makefile b/Makefile index d4a1667..7e36abd 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ SRC := $(filter-out $(wildcard meta_*),$(wildcard *.m4)) OUTPUTS := $(patsubst %.m4,out/%.html,$(SRC)) -STATIC := $(patsubst static/%,out/%,$(wildcard static/*)) +STATIC := $(patsubst static/%,out/%,$(wildcard static/* static/.*)) all: $(OUTPUTS) out/notes.atom out/notes.rss out/style.css $(STATIC) diff --git a/static/.htaccess b/static/.htaccess new file mode 100644 index 0000000..96c757e --- /dev/null +++ b/static/.htaccess @@ -0,0 +1,9 @@ +# www -> no-www + +RewriteEngine On +RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] +RewriteRule ^ %{REQUEST_SCHEME}://%1%{REQUEST_URI} [R,L] + + +# custom 404 page +ErrorDocument 404 /404.html -- 2.20.1