Title: Problem while redirecting from HTTP to HTTPS
Last modified: March 3, 2017

---

# Problem while redirecting from HTTP to HTTPS

 *  [Siddharth](https://wordpress.org/support/users/siddy1705/)
 * (@siddy1705)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/problem-while-redirecting-from-http-to-https/)
 * Hello,
 * I am new to WordPress. I am using W3TC on my WP website and the plugin has added
   a bunch of code in my HTACCESS file.
    Now i have added an SSL certificate and
   want to add a redirect code in HTACCESS on my site for redirecting from HTTP 
   to HTTPS. The code is:
 *     ```
       RewriteEngine On
       RewriteCond %{HTTPS} off
       RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
       ```
   
 * I tried to load my site after adding this code and it gives an error message 
   that the site is redirecting too many times.
 * I made a replica of that site on my local instance removed the W3TC which is 
   working fine.
 * Please let me know if that is happening because of the redirect code in W3TC 
   and if yes, is there any way to tackle that?
 * Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [amsgator](https://wordpress.org/support/users/amsgator/)
 * (@amsgator)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/problem-while-redirecting-from-http-to-https/#post-8887078)
 * Did you update your wordpress settings to https? If not it’s probably redirecting
   back and forth between http from wordpress and https from htaccess. If you have
   try:
 *     ```
       RewriteEngine On
       RewriteCond %{HTTPS} !on [NC]
       RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
       ```
   
    -  This reply was modified 9 years, 3 months ago by [amsgator](https://wordpress.org/support/users/amsgator/).
 *  Thread Starter [Siddharth](https://wordpress.org/support/users/siddy1705/)
 * (@siddy1705)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/problem-while-redirecting-from-http-to-https/#post-8892245)
 * [@amsgator](https://wordpress.org/support/users/amsgator/) Thank you for the 
   reply.
 * I tried it but it still happening the same. I changed the website URL from WP
   settings to HTTPS and also added the given code.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Problem while redirecting from HTTP to HTTPS’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [SSL](https://wordpress.org/support/topic-tag/ssl/)

 * 2 replies
 * 2 participants
 * Last reply from: [Siddharth](https://wordpress.org/support/users/siddy1705/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/problem-while-redirecting-from-http-to-https/#post-8892245)
 * Status: not resolved