I have an Apache website and I set up a redirect so that it will always go to the HTTPS version of the site. I added this under the port 80 Virtualhost configuration:
Redirect permanent / https://example.com
This works fine as I visit http://example.com, it is redirected to https://example.com.
But when I visit the site like http://example.com/page.php the trailing slash is removed. So instead of redirecting to https://example.com/page.php it is redirected to https://example.compage.php (which will result to an error).
I am using Ubuntu and the Apache version is: Apache/2.4.29 (Ubuntu)