Nextcloud on subdomain drops subdomain on base route

Nextcloud version: 18.0.3
Operating system and version : Ubuntu 18.04
Apache version: 2.4.29
PHP version: 7.4

Nearly pulling my hair out on a seemingly simple issue. I have an Apache2 server running with two VHosts setup for two different applications (WordPress and Nextcloud). Both are fresh installs and nothing should be outside of vanilla AFAIK. Wordpress is the primary domain (no subdomain, no subfolder). Nextcloud is set as a subdomain on the shared domain with wordpress. Both have their own document roots under different folders in /var/www/ and VHosts reflect this.

Both generally work. SSL is setup through Let’s Encrypt and certbot. HTTP routes to HTTPS by default for both apps. Pretty URLs work for nextcloud. Apache2 claims that the nextcloud VHost is the default server in an apache2 config program somewhere. Apache2 configtest indicates there are no issues in config.

However, the following redirects occur. HTTP always translates to HTTPS as desired in any combination.

sub.domain.tld -> domain.tld
sub.domain.tld/index.php -> sub.domain.tld/apps/files/

Since Wordpress is seemingly presenting no aberrant behavior on this issue, I suspected it must be the .htaccess file for nextcloud. I updated config/config.php for nextcloud with the following lines to no discernible change after the occ command to update the htaccess file.

'overwrite.cli.url' => 'sub.domain.tld',
'htaccess.RewriteBase' => '/',

I have naturally restarted apache2 many times. Again, most things work EXCEPT routing the ‘.’ or ‘/’ routes for nextcloud. I’ve tried looking at the htaccess file and hours of googling this and testing have provided no headway on this matter.

One curious effect is that disabling the WordPress VHost still has Nextcloud route to domain.tld as detailed above, but then it complains about trusted domains. I edited config.php to allow domain.tld as a test and it would not clear this issue.

I feel this is a very simple fix somewhere, but I’ve been up all night trying to figure it out like a fool to no avail. If someone could shed light on the exact issue, I’d be extremely grateful. Thank you in advance to anyone who takes a crack at it.