update htaccess files and makefile according to new setup
authorAmin Bandali <bandali@gnu.org>
Thu, 14 May 2020 08:41:45 +0000 (04:41 -0400)
committerAmin Bandali <bandali@gnu.org>
Thu, 14 May 2020 08:41:45 +0000 (04:41 -0400)
Makefile
static/.htaccess
static/.htaccess-www [new file with mode: 0644]

index 7e36abd..22073bd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,7 @@ out/notes.rss: meta_feed_rss.m4 ; m4 $< > $@
 $(STATIC): ; ln -s $(PWD)/static/$(notdir $@) $@
 
 deploy:
-       rsync -avzLP out/ abandali@bandali.eu.org:www/
+       rsync -avzLP out/ abandali@bandali.eu.org:www/site/
+       ssh abandali@bandali.eu.org mv www/site/.htaccess-www www/.htaccess
 
 .PHONY: deploy
index 4f38f87..fe09a63 100644 (file)
@@ -1,15 +1,7 @@
 <IfModule mod_rewrite.c>
-# don't add .html in the rewrite below
-Options -MultiViews
-
-RewriteEngine On
-RewriteBase /
-# if not already on bandali.eu.org, redirect to there
-RewriteCond %{HTTP_HOST} !^bandali\.eu\.org$
-RewriteRule ^(.*)$ https://bandali.eu.org/$1 [R]
-
-# now we have to explicitly tell apache that files with no
-# extension are actually .html
+# since we set Options -MultiViews in ../.htaccess, we now have to
+# explicitly tell apache that files with no extension are actually
+# .html files
 RewriteCond %{REQUEST_FILENAME}.html -f
 RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [L]
 </IfModule>
diff --git a/static/.htaccess-www b/static/.htaccess-www
new file mode 100644 (file)
index 0000000..87c80d1
--- /dev/null
@@ -0,0 +1,10 @@
+<IfModule mod_rewrite.c>
+# don't add .html in the rewrite below
+Options -MultiViews
+
+RewriteEngine On
+RewriteBase /
+# if on csclub.uwaterloo.ca, redirect to bandali.eu.org
+RewriteCond %{HTTP_HOST} ^csclub\.uwaterloo\.ca$
+RewriteRule ^(.*)$ https://bandali.eu.org/$1 [R]
+</IfModule>