This is a late answer but this works for me:
Change the RewriteCond to this
RewriteCond %{HTTP:X-Forwarded-Proto} !https
Should be like this:
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://yourdomain.com/$1 [R,L]
Related Posts:
- How to redirect url requests to https? [closed]
- https multiple redirects
- What is the right way to redirect all traffic to HTTPS?
- ReDirect subfolder link to another sub-folder and force SSL
- HTTPS to HTTP rewrite rules not working as expected
- Why is WordPress redirecting from http to https on a local environment?
- Redirect www to non-www htaccess
- 302 redirect instead of 301 after switch to HTTPS
- WordPress redirect loop on nginx + apache reverse proxy
- Redirect from https to http or from http to https? [closed]
- Redirect to https not working with .htaccess [closed]
- Mixed Content with SSL, wordpress behind a reverse proxy
- Menu links only using http after enabling https, unable to redirect http links
- some url does not redirect from http to https
- https redirect (with .htaccess) redirect loop
- WordPress Redirecting HTTPS Requests to HTTP
- Infinite loop behind SSL proxy on non-standard port
- 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
- 301 redirection editing .htaccess doesn’t work
- WordPress keeps redirecting subpages without http to https homepage after switch
- How to use https on one page only?
- .htaccess 301 redirect conflict with plugin “WordPress Https”
- WordPress CSS/Theme gone after SSL got activated
- My site doesn’t redirect from HTTP to HTTPS
- Only execute function if SSL is set up properly
- Understanding Redirects
- WordPress site not forcing from http to https instead getting redirected too many times
- I get “too many redirects” problem when migrating localhost site
- Redirect HTTP request to HTTPS request
- Moving site from HTTP to HTTPS
- How to force HTTP and stop SSL completey on WordPress website
- How do I skip wordpress’s 404 handling and redirect all 404 errors for static files to 404.html?
- Redirect entire website to a single page
- Stop WordPress and Plugins from Overwriting .htaccess
- Site redirects to wrong url when saving settings
- Index in root, wordpress in subdirectory
- htaccess redirect – directory and subpages to a single page
- htaccess redirect dynamic posts
- RedirectMatch and Redirect interfering with each other
- WordPress site in subdirectory load site in main directory
- How to properly force https and www on multisite with Apache HTAccess
- Why does multisite bypass WordPress for wp-content, wp-admin, wp-includes and .php files?
- Why can’t I access files / directories outside of wordpress
- Redirect blogpage /blog/abcd/ to /blog/
- How do I map a subdomain in wordpress to the primary domain in a multisite setup?
- Redirect all pages except one to homepage via .htaccess
- htaccess redirects and WordPress
- htaccess rules not applied?
- Use virtual pages point to one specific page
- htaccess redirect – replace special character
- Load time cost of using a redirect plugin v direct .htaccess entry
- How to set 301 redirection after moving WordPress blog?
- Redirecting amp url to non amp url
- Redirect all requested url to new url
- Redirect custom post type from one domain to another domain
- Can’t control WordPress Addresses from admin panel
- Redirect htaccess does not work correctly with my new wordpress site
- 301-redirect directives for blogger to wordpress migration
- reducing number of URL Redirects and increasing speed
- Locked out of admin and some pictures don’t show after failed SSL installation
- How do I put up a splash page and have all WordPress links redirect to this page?
- Redirect – remove custom query string
- Redirect specific URL before other redirects take place in .htaccess?
- Force WordPress https redirect before www redirect based on site address url
- Prevent wordpress autoredirect
- How to fix too many redirects when enabling SSL for site?
- Stop forcing certain paths to end with a forward slash
- How to redirect only 404 pages with htaccess in WordPress
- How to redirect the frontend of a WordPress site (only)?
- Permalinks do not include www subdomain
- I want to resolve Redirect Chain [closed]
- How to fix URL with pageid example /?p= too many redirection error
- 301 redirect any RSS feed on level up url
- Redirection with a wildcard
- Date based redirects of posts that no longer exist
- WordPress redirect to new domain name
- 301 all old pages to new location
- www redirects to another directory in wordpress
- Open wordpress page in directory the way index.html would open
- Use a 301 to Redirect any 404 from at the blog post level to the blog archive
- 301 Redirect Loop www to non-www – Nginx + Apache2
- how to redirect 404 to attachment.php?
- Using cache brokes redirecting
- 301 Redirect in WordPress not working in htaccess
- Why https://www. SUBdomain is redirected by WP to https://MAINdomain
- Redirect after login when WordPress in subdirectory
- Redirect after Permalink change – What regex do I use?
- Allow GET request on certain page
- .htaccess redirect for old subfolder installation to new subfolder installation and https
- Pagination redirect set in .htaccess file is not working
- Force SSL on a single page which is used as iFrame
- htaccess and redirect to new url using regex
- How to redirect correctly a root domain to a subdomain in a subfolder?
- Need rewrite for URL with specific string
- How to redirect all pages of a blog to a new blog
- WordPress subfolders htaccess bypassing the root htaccess RewriteRule
- How does the flow of htaccess files in sub-directories work
- How to Redirect Url to homepage?
- redirect the root of a domain, while leaving the www version unredirected