Moving off SSG
Not since I discovered a $1 web hosting had I gone back to good old PHP to whip up a custom-made CMS for this personal blog. This borne from the tedium of Zola’ing, git versioning, and FTP’ing each single post each single time, tasks which could only be done on a non-portable computing machine. The claustrophobic me foresaw and flinched at the idea of hundreds of flat files fattening up the content directory and concluded all blog posts should be stashed into a clandestine SQL binary. The result: a PHP solution living in the ubiquitous web browser. So here we were, a not really new website re-assembled in an old school way.
One last thing, for keepsake:
# One HTACCESS to rule them all,
# One HTACCESS to find them,
# One HTACCESS to bring them all and in the darkness bind them.
RewriteEngine On
# Force HTTPS and www.
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301]
# Route all requests thru index.php.
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L,QSA]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# Fallback pages for common errors.
ErrorDocument 403 /void.html
ErrorDocument 404 /void.html
ErrorDocument 500 /kaboom.html