Website deploy script and clean URLs for the legal pages
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b67843e00f
commit
5721eb53c9
16
server/deploy-site.sh
Normal file
16
server/deploy-site.sh
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Publishes the nkbmusic.com website staged in ~dev/nk-site to the Hestia web root.
|
||||||
|
# Run as dev: sudo sh ~/APPS/nanga_kathai/server/deploy-site.sh
|
||||||
|
set -e
|
||||||
|
SRC=/home/dev/nk-site
|
||||||
|
DEST=/home/user/web/nkbmusic.com/public_html
|
||||||
|
|
||||||
|
[ -f "$SRC/index.html" ] && [ -f "$SRC/config.js" ] || { echo "Nothing staged in $SRC"; exit 1; }
|
||||||
|
mkdir -p /home/dev/nk-site-backups
|
||||||
|
tar -czf "/home/dev/nk-site-backups/public_html-$(date +%Y%m%d-%H%M%S).tgz" -C "$DEST" .
|
||||||
|
rm -rf "${DEST:?}"/*
|
||||||
|
cp -a "$SRC"/. "$DEST"/
|
||||||
|
chown -R user:user "$DEST"
|
||||||
|
find "$DEST" -type d -exec chmod 755 {} +
|
||||||
|
find "$DEST" -type f -exec chmod 644 {} +
|
||||||
|
echo "Published to $DEST"
|
||||||
13
site/.htaccess
Normal file
13
site/.htaccess
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# nkbmusic.com on Hestia (Apache behind nginx). Serves /privacy, /terms and /delete-account
|
||||||
|
# from the matching .html files.
|
||||||
|
Options -MultiViews
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME}.html -f
|
||||||
|
RewriteRule ^([a-z-]+)/?$ $1.html [L]
|
||||||
|
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
<FilesMatch "\.(jpg|png|css|js)$">
|
||||||
|
Header set Cache-Control "public, max-age=86400"
|
||||||
|
</FilesMatch>
|
||||||
|
</IfModule>
|
||||||
Loading…
x
Reference in New Issue
Block a user