Http to https redirection with WP's trailing slash happening in wrong order

Hi everybody,

I have a WP install in domain root, and I have two other WP installs in different subfolders.

If a visitor goes to example.com/subFolder or to www.example.com/subFolder, this happens:

http://sitename/subFolder
http://sitename/subFolder/ #trailing slash is added
https://sitename/subFolder/

I have been told that the proper order should be this:

http://sitename/subFolder
https://sitename/subFolder
https://sitename/subFolder/

Domain root redirects okay.

http://sitename/
https://sitename/

non-www to www redirect is not done in .htaccess file. It is handled by hosting company.

Can the order be fixed in .htaccess file, and how it should be done?
If I let it be like this, will it create security or SEO issues?

My current .htaccess setup in domain root is:

first some security hardening
then the redirect
<IfModule mod_rewrite.c>
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
</IfModule>
caching rules
WordPress

Setup in subFolder:

first some security hardening
then the redirect
<IfModule mod_rewrite.c>
RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteCond %{REQUEST_URI} subFolder 
RewriteRule ^(.*)$ https://www.example.com/subFolder/$1 [R=301,L]
</IfModule>
caching rules
WordPress

I have tried removing the subFolder redirects, and using only the root version.
I have also tried this in the root with no success.

<IfModule mod_rewrite.c>
RewriteEngine On 
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]
</IfModule>

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.