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 ac527ba..73da825 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,8 @@ "prod": "rm -rf public && hugo --minify --environment production && node themes/hugo-theme-lowtech/scripts/typo && DATE=`date +\"%Y0101\"` && find public -exec touch -d $DATE {} + && docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build --force-recreate", "favicon": "convert content/lestoitsduval-icon.png -resize 32x32 -colors 16 \\( -clone 0 -resize 16x16 -extent 16x16 \\) \\( -clone 0 -resize 32x32 -extent 32x32 \\) -delete 0 static/favicon.ico", "svgo": "svgo */**.svg", + "ftp-deploy": "lftp -u $LESTOITSDUVAL_FTP_USER,$LESTOITSDUVAL_FTP_PASSWORD $LESTOITSDUVAL_FTP_HOST -e 'mirror -e -R ./public /www ; quit'", + "ftp-htaccess": "lftp -u $LESTOITSDUVAL_FTP_USER,$LESTOITSDUVAL_FTP_PASSWORD $LESTOITSDUVAL_FTP_HOST -e 'put ./.htaccess ; quit'", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Simon ",