htaccess – How can I fix the redirect string after implementing SSL on WordPress?

After implementing ssl on wordpress, I wanted to force a redirect to a site with the following characteristics:

no www, ssl, with final slash

Unfortunately, this only works in some cases.

For example, instead of redirecting from a site with these features (http, no www, no drag, slash to non https www with end slash), it redirects as follows:

http: // examplesite / example on https: // examplesite / example to https: // examplesite / example /

I also have a problem with redirecting a www site, http without a final slash to an https site, not www, with a slash end site.

Currently, it redirects from http: //www.examplesite/example via http: // examplesite / example to https: // examplesite / example and https: // examplesite / example /

Therefore, my question is: how can I solve this problem? Is this done in one way or another by the WordPress system?

You will find attached my htaccess file. I hope you can help me.

RewriteEngine On

RewriteBase /

RewriteCond% {HTTPS} disabled [OR]

RewriteCond% {HTTP_HOST} ^ www. [NC]

RewriteCond% {HTTP_HOST} ^ (?: Www.)? (. +) $ [NC]

RewriteRule ^ https: //% 1% {REQUEST_URI} [L,NE,R=301]

RewriteCond% {REQUEST_URI}! Wp-content / cache / (all | wpfc-mobile-cache)

Could this be somehow caused by WordPress? I have already mentioned it, but there is also a wordpress rewrite code.

START WordPress

RewriteEngine On

RewriteBase /

RewriteRule ^ index.php $ – [L]



RewriteRule. /index.php [L]