RewriteBase issue - nav links contain subdirectory?

I’m running Kirby on shared hosting with A Small Orange. The shared hosting has a url like https://subdomain.maindomain.com/~username

Today I set up my domain A Record (under a different registrar) and Cloudflare (using their nameservers).

I’m observing the following behavior:

  1. Go to https://mysite.com
  2. Click on a nav link created using <a href="<?php echo $p->url() ?>">
  3. Land on https://mysite.com/mylinkworks
  4. Observe that now the nav links are all https://mysite.com/~username/badlink
  5. Click on a nav link
  6. Land on https://mysite.com/~username/badlink

What is up?

relevant .htaccess:

 # rewrite rules
<IfModule mod_rewrite.c>

# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine On
RewriteCond %{HTTP_PORT} 80 [OR]
RewriteCond %{HTTP_HOST} ^www\.mysite\.vc$ [NC]
RewriteRule ^(.*)$ https://mysite.vc/$1 [R=301,L]

# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder.
# Otherwise links or the entire site will break.
#
# If your homepage is http://yourdomain.com/mysite
# Set the RewriteBase to:
#
 RewriteBase /~username

# block text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]

# block all files in the site folder from being accessed directly
RewriteRule ^site/(.*) index.php [L]

# block all files in the kirby folder from being accessed directly
RewriteRule ^kirby/(.*) index.php [L]

# make panel links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^panel/(.*) panel/index.php [L]

# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

</IfModule>

If the domain is set to the username subdirectory, the RewriteBase should be /.

Whoops wow that was an end-of-day mistake. Had RewriteBase’s behavior backwards. Thanks!