Title: wp super cache force to https
Last modified: August 20, 2016

---

# wp super cache force to https

 *  Resolved [bigt11](https://wordpress.org/support/users/bigt11/)
 * (@bigt11)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/wp-super-cache-force-to-https/)
 * My site is pure https and if someone trys to visit http, I have a mod rewrite
   rule to force it to https.
 * Im using super cache with mod rewrite. Before I ws using super cache I was using
   this to redirect to https
 *     ```
       RewriteCond %{HTTPS} off
       RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
       ```
   
 * When super cache is on and its rules are below the above code, the site has an
   issue when someone attempts to visit http of the site, it loads a blank page.
   If they visit the https address, it works just fine.
 * What i did as a temporary workaround is edit the supercache rules to bolow. All
   i did was remove “index.html” add “index-https.html” to the paths that the super
   cache are fetching the cache file causing to fetch the https cache file, but 
   the url in the browser window is still http”.
 * I want the browser url to also redirect to a https page no matter what even if
   they request a http address.
 * HERE is my workaround so far, there has to be a better way
 *     ```
       #------------------------------ TAO SSL Redirect START-------------------------------------#
       # TAO - the rule below, will redirect the whole -everything to https format
       #RewriteCond %{HTTPS} off
       #RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
       #------------------------------ TAO SSL Redirect STOP-------------------------------------#
   
       # BEGIN WPSuperCache
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
   
       #If you serve pages from behind a proxy you may want to change 'RewriteCond %{HTTPS} on' to something more sensible
       AddDefaultCharset UTF-8
       RewriteCond %{REQUEST_URI} !^.*[^/]$
       RewriteCond %{REQUEST_URI} !^.*//.*$
       RewriteCond %{REQUEST_METHOD} !POST
       RewriteCond %{QUERY_STRING} !.*=.*
       RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
       RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Accept-Encoding} gzip
       RewriteCond %{HTTPS} on
       RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz -f
       RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz" [L]
   
       RewriteCond %{REQUEST_URI} !^.*[^/]$
       RewriteCond %{REQUEST_URI} !^.*//.*$
       RewriteCond %{REQUEST_METHOD} !POST
       RewriteCond %{QUERY_STRING} !.*=.*
       RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
       RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Accept-Encoding} gzip
       RewriteCond %{HTTPS} !on
       RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz -f
       RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz" [L]
   
       RewriteCond %{REQUEST_URI} !^.*[^/]$
       RewriteCond %{REQUEST_URI} !^.*//.*$
       RewriteCond %{REQUEST_METHOD} !POST
       RewriteCond %{QUERY_STRING} !.*=.*
       RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
       RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTPS} on
       RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html -f
       RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html" [L]
   
       RewriteCond %{REQUEST_URI} !^.*[^/]$
       RewriteCond %{REQUEST_URI} !^.*//.*$
       RewriteCond %{REQUEST_METHOD} !POST
       RewriteCond %{QUERY_STRING} !.*=.*
       RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
       RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTPS} !on
       RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html -f
       RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html" [L]
   
       </IfModule>
   
       # END WPSuperCache
       ```
   
 * [http://wordpress.org/extend/plugins/wp-super-cache/](http://wordpress.org/extend/plugins/wp-super-cache/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [bigt11](https://wordpress.org/support/users/bigt11/)
 * (@bigt11)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/wp-super-cache-force-to-https/#post-3383692)
 * Ok shortly after posting this I think i answered my own question, the solution
   is to comment out the rules for redirecting to the plain http cache files and
   above the super cache rules in my original redirect to https rules I added a “[
   L]” to the end of it. Below works for me
 *     ```
       #------------------------------ TAO SSL Redirect START-------------------------------------#
       # TAO - the rule below, will redirect the whole -everything to https format
       RewriteCond %{HTTPS} off
       RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
       #------------------------------ TAO SSL Redirect STOP-------------------------------------#
   
       # BEGIN WPSuperCache
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
   
       #If you serve pages from behind a proxy you may want to change 'RewriteCond %{HTTPS} on' to something more sensible
       AddDefaultCharset UTF-8
       RewriteCond %{REQUEST_URI} !^.*[^/]$
       RewriteCond %{REQUEST_URI} !^.*//.*$
       RewriteCond %{REQUEST_METHOD} !POST
       RewriteCond %{QUERY_STRING} !.*=.*
       RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
       RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Accept-Encoding} gzip
       RewriteCond %{HTTPS} on
       RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz -f
       RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz" [L]
   
       #RewriteCond %{REQUEST_URI} !^.*[^/]$
       #RewriteCond %{REQUEST_URI} !^.*//.*$
       #RewriteCond %{REQUEST_METHOD} !POST
       #RewriteCond %{QUERY_STRING} !.*=.*
       #RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
       #RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
       #RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       #RewriteCond %{HTTP:Accept-Encoding} gzip
       #RewriteCond %{HTTPS} !on
       #RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz -f
       #RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz" [L]
   
       RewriteCond %{REQUEST_URI} !^.*[^/]$
       RewriteCond %{REQUEST_URI} !^.*//.*$
       RewriteCond %{REQUEST_METHOD} !POST
       RewriteCond %{QUERY_STRING} !.*=.*
       RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
       RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTPS} on
       RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html -f
       RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html" [L]
   
       #RewriteCond %{REQUEST_URI} !^.*[^/]$
       #RewriteCond %{REQUEST_URI} !^.*//.*$
       #RewriteCond %{REQUEST_METHOD} !POST
       #RewriteCond %{QUERY_STRING} !.*=.*
       #RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
       #RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
       #RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       #RewriteCond %{HTTPS} !on
       #RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html -f
       #RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html" [L]
   
       </IfModule>
   
       # END WPSuperCache
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘wp super cache force to https’ is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=1095422)
 * [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/)

 * 1 reply
 * 1 participant
 * Last reply from: [bigt11](https://wordpress.org/support/users/bigt11/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/wp-super-cache-force-to-https/#post-3383692)
 * Status: resolved