Title: HTTP to HTTPs?
Last modified: August 30, 2016

---

# HTTP to HTTPs?

 *  Resolved [criscmaia](https://wordpress.org/support/users/criscmaia/)
 * (@criscmaia)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/)
 * I can’t find a way to automatically redirect all http links to the https version
   of it.
 * This is my current cache:
    # BEGIN WordPress <IfModule mod_rewrite.c> RewriteRule
   ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}!-
   d RewriteRule . /index.php [L] </IfModule> # END WordPress
 * Thanks
 * [https://wordpress.org/plugins/wp-super-cache/](https://wordpress.org/plugins/wp-super-cache/)

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/http-to-https-8/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/http-to-https-8/page/2/?output_format=md)

 *  [camisatx](https://wordpress.org/support/users/camisatx/)
 * (@camisatx)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421962)
 * I am assuming that you are changing these lines in the .htaccess area?
 * Assuming this, I would suggest adding this redirect in a separate # block. If
   you keep it in the WordPress # section, it will be removed anytime you have to
   rebuild the Permalinks data.
 * The 301 redirect flag indicates that it is permanent redirect.
 *     ```
       # BEGIN Custom
   
       # Redirect a user from HTTP to HTTPS
       RewriteCond %{HTTPS} off
       RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
   
       # END Custom
       ```
   
 *  [Mithilesh Kumar](https://wordpress.org/support/users/mithilesh-kumar/)
 * (@mithilesh-kumar)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421969)
 * Have you checked your domain is ssl certified or not if yes then you should add
   the following code in your .htaccess file. i hope it will help you.
 * RewriteEngine On
    RewriteCond %{HTTPS} off RewriteRule (.*) [https://%](https://%){
   HTTP_HOST}%{REQUEST_URI} [R,L]
 *  Thread Starter [criscmaia](https://wordpress.org/support/users/criscmaia/)
 * (@criscmaia)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421972)
 * Thanks for the suggestion, guys. It didn’t work yet.
 * On Chrome, it gives the TOO_MANY_REDIRECTIONS error message.
 * Also, the website is ssl certified, [@mithilesh](https://wordpress.org/support/users/mithilesh/)
   Kumar.
 * With the original .htcaccess, this is what happens:
    [https://www.dukescasino.com/](https://www.dukescasino.com/)–
   works perfectly [https://dukescasino.com/](https://dukescasino.com/) – redirects
   to the above which is great
 * The two options below loads fine, but it should redirect to the https version:
   
   [http://www.dukescasino.com/](http://www.dukescasino.com/) [http://dukescasino.com/](http://dukescasino.com/)
 * Here is the full .htcaccess file that gives the error message:
 *     ```
       <IfModule mod_rewrite.c>
       RewriteEngine On
   
       # BEGIN WordPress
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
   
       # BEGIN Custom
       # Redirect a user from HTTP to HTTPS
       RewriteCond %{HTTPS} off
       RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
       # END Custom
       </IfModule>
       ```
   
 *  [Mithilesh Kumar](https://wordpress.org/support/users/mithilesh-kumar/)
 * (@mithilesh-kumar)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421973)
 * have u using woocommerce???
 *  Thread Starter [criscmaia](https://wordpress.org/support/users/criscmaia/)
 * (@criscmaia)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421974)
 * Nope. No e-commerce at all.
 *  Thread Starter [criscmaia](https://wordpress.org/support/users/criscmaia/)
 * (@criscmaia)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421975)
 * Here is the list of active plugins. I don’t think they are related with the issue
   but never know:
 *     ```
       Advanced Custom Fields
       All In One SEO Pack
       Bop Search Box Item Type For Nav Menus
       Contact Form 7
       Disable Comments
       Google XML Sitemaps
       Jetpack by WordPress.com
       Search & Filter
       Slider WD
       TablePress
       UpdraftPlus - Backup/Restore
       Wordfence Security
       WPide
       WP Smush
       WP Super Cache
       ```
   
 *  Thread Starter [criscmaia](https://wordpress.org/support/users/criscmaia/)
 * (@criscmaia)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421977)
 * Full detailed discussion with tests on stackoverflow:
 * [http://stackoverflow.com/questions/32049820/use-htaccess-to-redirect-http-to-https](http://stackoverflow.com/questions/32049820/use-htaccess-to-redirect-http-to-https)
 *  [camisatx](https://wordpress.org/support/users/camisatx/)
 * (@camisatx)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421979)
 * I am taking a guess here, but it could have to do with the entire code being 
   within the <IfModule mod_rewrite.c> block. Which if the first is the case, then
   the entire block may be being skipped over, ignoring any redirect. This makes
   sense because the HTTP isn’t changing to HTTPS.
 * Also, I suggest adding “# END SECTION” to each # section. There are some plugins
   that change the .htaccess, and (as far as I know) they add code based on defined#
   sections.
 * I am not sure what is going on with this rule:
 *     ```
       RewriteRule ^index\.php$ - [L]
       ```
   
 * It’s not being impacted by any condition above it, so it could be causing some
   problems (esp since it’s flagged as Last). Make sure that those lines are the
   WordPress default code (I don’t know what that is, as I use optimized code instead,
   so this may in fact be right, idk).
 *     ```
       # BEGIN CRISCMAIA CUSTOM
       RewriteEngine on
       RewriteCond %{HTTPS} off
       RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
       # END CRISCMAIA CUSTOM
   
       # BEGIN WordPress
       RewriteEngine on
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       # END WordPress
       ```
   
 *  Thread Starter [criscmaia](https://wordpress.org/support/users/criscmaia/)
 * (@criscmaia)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421980)
 * Thanks for the suggestion, unfortunately, it didn’t work yet. I keep getting 
   the ERR_TOO_MANY_REDIRECTS.
 * According to the WP documentation, here is the defautl .htaccess file:
 *     ```
       # BEGIN WordPress
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
       # END WordPress
       ```
   
 *  [Mithilesh Kumar](https://wordpress.org/support/users/mithilesh-kumar/)
 * (@mithilesh-kumar)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421983)
 * whats your domain, can you tell me the url
 *  [Mithilesh Kumar](https://wordpress.org/support/users/mithilesh-kumar/)
 * (@mithilesh-kumar)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421984)
 * will you plz deactivate tablepress and super cache plugin and please check wp-
   config.php file ::
 * define(‘FORCE_SSL_ADMIN’, true)
 *  Thread Starter [criscmaia](https://wordpress.org/support/users/criscmaia/)
 * (@criscmaia)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421986)
 * Problem solved!
 * Final .htaccess:
 *     ```
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
   
       RewriteCond %{ENV:HTTPS} !=on
       RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
   
       # BEGIN WordPress
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
       ```
   
 *  Thread Starter [criscmaia](https://wordpress.org/support/users/criscmaia/)
 * (@criscmaia)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6421987)
 * Topic closed.
 *  [Charya](https://wordpress.org/support/users/charya/)
 * (@charya)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6422021)
 * Could you show me how you replace your site name in this code?
 *  Thread Starter [criscmaia](https://wordpress.org/support/users/criscmaia/)
 * (@criscmaia)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/#post-6422022)
 * Sure! You have to find the .htaccess file on the root of your website (via FTP).
 * Download it to your pc, make a copy of it (just for backup purpose), open it 
   with a Notepad (or similar), copy/paste the code, save the file, upload it back
   to the server overwriting the current file.
 * That should do.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/http-to-https-8/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/http-to-https-8/page/2/?output_format=md)

The topic ‘HTTP to HTTPs?’ is closed to new replies.

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

## Tags

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

 * 17 replies
 * 4 participants
 * Last reply from: [criscmaia](https://wordpress.org/support/users/criscmaia/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/http-to-https-8/page/2/#post-6422027)
 * Status: resolved