In the root directory I am running wordpress and within root directory I have a directory called 'y' where I run yourls url shortening platform. Wordpress should be access through www.example.com while Yourls should be accessed through example.com/y/.
This was running fine until I switched from shared hosting to a VPS setup with Plesk/Apache/Nginx, DNS and SSL configured via Cloudflare.
Root/Wordpress works fines but y/yourls throws HTTP ERROR 500 with no log captured in /var/www/vhosts/system/example.com/logs/error_log.
Accessing https://example.com/y/ tries to load a dummy index.html I've placed there, indicating that it's not following the RewriteRule mentioned in htaccess file. (This is a wrong assumption, as indicated by @Cbroe in the comments below).
How can this be fixed? What can I do to debug this further?
Root directory .htaccess as requested by wordpress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
y directory .htaccess as recommended in the yourls docs
# BEGIN YOURLS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /y/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /y/yourls-loader.php [L]
</IfModule>
# END YOURLS
my apache config is located in /var/www/vhosts/system/example.com/conf/httpd.conf and among other things has this config two times, once for virtualhost on port 7080 and again for virtualhost on port 7081
<Directory /var/www/vhosts/example.com>
Options -FollowSymLinks
AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,SymLinksIfOwnerMatch,MultiViews,ExecCGI,Includes,IncludesNOEXEC
</Directory>
Turns out my .htaccess and apache config was actually fine and the problem was in fact caused by the newer PHP 8 version that I have on the new host setup vs PHP 7 which I had on the old shared hosting setup.
This issue has been fixed by Yourls and is mentioned in this PR. By upgrading to the latest Yourls version 1.9.2 everything went back to normal.