diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..62663dd --- /dev/null +++ b/.htaccess @@ -0,0 +1,10 @@ +Errordocument 404 /404.html +RewriteEngine On + +## http -> https +RewriteCond %{HTTPS} off +RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] + +## www -> no-www +RewriteCond %{HTTP_HOST} ^www\.(.*)$ +RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L] diff --git a/package.json b/package.json index 21587f1..851425c 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "build": "rm -rf public && hugo -D --minify", "favicon": "convert static/icon.png -resize 32x32 -colors 16 \\( -clone 0 -resize 16x16 -extent 16x16 \\) \\( -clone 0 -resize 32x32 -extent 32x32 \\) -delete 0 static/favicon.ico", "deploy": "docker-compose up -d --build", + "ftp-deploy": "lftp -u $HISTOIREDUNPIED_FTP_USER,$HISTOIREDUNPIED_FTP_PASSWORD $HISTOIREDUNPIED_FTP_HOST -e 'mirror -e -R ./public /www ; quit'", + "ftp-htaccess": "lftp -u $HISTOIREDUNPIED_FTP_USER,$HISTOIREDUNPIED_FTP_PASSWORD $HISTOIREDUNPIED_FTP_HOST -e 'put ./.htaccess ; quit'", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Simon ",