inspiration:

perishablepress.com/better-default-directory-views-with-htaccess/

apache-conf:

IndexOptions SuppressHTMLPreamble FancyIndexing
HeaderName /php/dirlist/dirlist-header.html
        

shell vscode remote:

code /etc/apache2/sites-enabled/000-default-le-ssl.conf
apachectl restart
        

php (disabled):

[php $dir = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); ]
[= $dir ]
        

.htaccess


AddHandler application/x-httpd-php .html

########################

RewriteEngine on

# a directory
RewriteCond %{REQUEST_FILENAME} -d

# without index files
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f

# exception case: explicitly use Apache dirlist
RewriteCond %{REQUEST_FILENAME} !(.*/_.*)

RewriteRule (.*) php/dirlist/dirlist.html

########################