For posterity:
- Create /webroot/2020/grav.
- Fill it with candy, ie. a full Grav-installation.
- Add a
AddType application/x-httpd-ea-php72 .php
handler to /webroot/2020/grav/.htaccess because the server defaults to outdated PHP. - Edit / webroot/2020/grav/user/config/system.yaml and add this:
custom_base_url: 'http://domain.tld/2020'
session:
path: /2020
- Create /webroot/2020/.htaccess with:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/2020/grav/
RewriteRule ^(.*)$ /2020/grav/$1
- Profit!
A recipe from 2016 actually exists: https://github.com/getgrav/grav/pull/896, even some nice clues in an old forum post: Grav in subfolder without site visitors ever knowing.