In moving to https URLs for my self-hosted site, I added a redirect to the .htaccess file:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
This redirects to http to https for all pages, except for my blog. The blog is a WordPress installation in a subdirectory called bestpractices. When I click on any link leading to a blog page, the slash is removed from after the domain, so http://www.example.com/bestpractices becomes https://www.example.combestpractices.
The WordPress subfolder has its own .htaccess file with the standard WP auto-generated text:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /bestpractices/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /bestpractices/index.php [L]
</IfModule>
Perhaps the issue is caused by this, since the problem occurs only with WordPress pages. I don't know enough about rewrites to tell.
I thought I found an answer here, since the question seems to match my setup: Trying to redirect with and without trailing slash, but the top answer does not solve the problem. I still get the same result.