Your rewrite conditions, line 4 to 6 in your code, apply when https is active, so you are redirecting from https to https. Consquently you should change the conditions to check, if https is not active, ergo !on
and !^443$
and !https
. Additionally I’m not sure about the rule RewriteRule .* - [E=WPR_SSL:-https]
, probably something WP Rocket specific and out of scope here, which is why I suggest to possibly replace it with RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
.
In conclusion, I’d say, replace line 4 to 7 of your .htaccess
with:
RewriteCond %{HTTPS} off
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Related Posts:
- Why is WordPress redirecting from http to https on a local environment?
- Moving site from HTTP to HTTPS
- How to force HTTP and stop SSL completey on WordPress website
- Force HTTPS using .htaccess – stuck in redirect loop
- How to redirect url requests to https? [closed]
- Redirect www to non-www htaccess
- WordPress redirect loop on nginx + apache reverse proxy
- Redirect from https to http or from http to https? [closed]
- Mixed Content with SSL, wordpress behind a reverse proxy
- Cant Access Website – Changed HTTP to HTTPs
- https multiple redirects
- WordPress Redirecting HTTPS Requests to HTTP
- Infinite loop behind SSL proxy on non-standard port
- What is the right way to redirect all traffic to HTTPS?
- How to use https on one page only?
- ReDirect subfolder link to another sub-folder and force SSL
- WordPress CSS/Theme gone after SSL got activated
- Only execute function if SSL is set up properly
- HTTPS to HTTP rewrite rules not working as expected
- Understanding Redirects
- I get “too many redirects” problem when migrating localhost site
- Redirect HTTP request to HTTPS request
- WordPress HTTPS – ‘… better to use HTTP for installation …’
- How to redirect all HTTP requests to HTTPS
- What does HTTP/1.1 302 mean exactly?
- How do you redirect HTTPS to HTTP?
- Keeps on redirecting on my development copy
- Upgrade to SSL Breaks Admin Dashboard
- 302 redirect instead of 301 after switch to HTTPS
- How are both HTTP and HTTPS versions displaying?
- Redirect to https not working with .htaccess [closed]
- Disabling the X-Redirect-By response header
- Get the final destination after WP_Http redirects (WordPress)
- Menu links only using http after enabling https, unable to redirect http links
- Disabling HTTPS redirection for migration
- some url does not redirect from http to https
- Strange redirection issues on wordpress from ssl with padlock to ssl without padlock
- https redirect (with .htaccess) redirect loop
- Redirect HTTP to HTTPS
- Divert http to https with WordPress on IIS
- How do I map a subdomain in wordpress to the primary domain in a multisite setup?
- Site redirecting from http to https [closed]
- 403 error on admin login page
- SSL and www to non-www redirection works only on homepage – WordPress
- Htaccess file isn’t redirecting http sub-pages to https––they display 404 error instead, tried many solutions and none work
- Redirect HTTP to HTTPS for all sub domains (blog posts)
- 301 redirection editing .htaccess doesn’t work
- WordPress keeps redirecting subpages without http to https homepage after switch
- https – too many redirects
- Too many redirects after added SSL redirect on port 80 virtual host
- Allow non-SSL pages to use https or Force non-SSL pages to http?
- .htaccess 301 redirect conflict with plugin “WordPress Https”
- All content is HTTPS, but browsers warn of HTTP mixed content [closed]
- Force WordPress https redirect before www redirect based on site address url
- How to fix too many redirects when enabling SSL for site?
- WordPress index.php seems to perform unwanted redirect 301
- How to make my site use HTTPS for images or how to insert images as relative paths?
- Why does WP HTTP API switch the method (POST/PURGE) to GET when redirecting (302)?
- https to https problem – 404 and can’t login
- Wp Remote get with manual redirect
- Browsers Forcing Multisite to https
- Is the default value of FORCE_SSL_ADMIN documented?
- Redirecting specific sites to HTTP in WordPress Multisite
- Website Migration (with https) to a new domain(http)
- How to replace the links http to https
- Why does WordPress uses HTTPS for JS, CSS on EC2
- Specific Page/Post Need to Stay Non SSL
- 301 Redirect Loop www to non-www – Nginx + Apache2
- Why https://www. SUBdomain is redirected by WP to https://MAINdomain
- WordPress site not forcing from http to https instead getting redirected too many times
- Implications of not completing all tasks when switching to HTTPS
- How to force the admin-ajax.php file to load over HTTPS?
- Configure WordPress to listen on a port other than 80
- redirect_to ignoring the SSL
- How to switch static files back to using HTTP instead of HTTPS?
- I have cloudflare flexible enabled, How to redirect to https for Nginx server
- Force SSL on a single page which is used as iFrame
- How to move a https website back to dev and access the admin?
- Any idea on how to fix this error when forcing SSL on a certain page?
- Detect if request is coming from wordpress conditional statement
- How to map secure.domain.com to www.domain.com or domain.com with “WordPress MU Domain Mapping” on the primary multisite domain?
- Nice font not working when http to https – SSL Issue
- The plain HTTP request was sent to HTTPS port in wordpress [closed]
- Is it bad to redirect http to https?
- Best way to redirect all HTTP to HTTPS in IIS
- Changing my URL in General Settings cause the site to crash
- My wordpress multisite homepage redirects to signup page
- Redirecting to home-page when saving any edited code
- Can WordPress redirect to a “similar page” in case of 404 error
- How to auto login after registration? [duplicate]
- WordPress Permalink Problem 404
- Select post from dropdown and add query args not working
- Trying to map a PURL like url to a page
- Can’t login to WordPress admin panel after changing domain to use WordPress pages as a fallback from React
- ERR_TOO_MANY_REDIRECTS when switching from good database to old database
- Redirect to /404/
- Redirect affecting development folder
- login page not working [closed]
- Debugging a redirect loop affecting only certain pages
- noheader on the user/frontend side