Title: HTTPS and redirection issue
Last modified: September 1, 2016

---

# HTTPS and redirection issue

 *  Resolved [dccs52](https://wordpress.org/support/users/dccs52/)
 * (@dccs52)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/https-and-redirection-issue/)
 * Hi
 * Love cache enabler and thank you to al involved, recently we used it on a site
   which is HTTPS throughout the site (first time with SITE 100% ssl with CE)
 * We have the correct redirects in the htaccess for SSL vut we are seeing when 
   the user tries to access a non SSL link the URL is redirected the https:// but
   the URL reads:
 * [https://www.mysite.co.uk/wp-content/cache/cache-enabler/www.mysite.co.uk/index.html](https://www.mysite.co.uk/wp-content/cache/cache-enabler/www.mysite.co.uk/index.html)
 * We used rocket cache in the past and they had a similar problem, documented here:
 * [http://docs.wp-rocket.me/article/36-fix-for-ssl-redirection-issue](http://docs.wp-rocket.me/article/36-fix-for-ssl-redirection-issue)
 * (sorry i don’t meant to link to a different cacheing plugin, its just its the
   exact same issue that displays it)
 * Can you offer a possible solution as struggling to work out why.
 * We are using the the advanced htaccess snippet from the keycdn site you provide
   and pre compression, minification and webP have been turned off in the settings.
 * [https://wordpress.org/plugins/cache-enabler/](https://wordpress.org/plugins/cache-enabler/)

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

 *  [Brian Jackson](https://wordpress.org/support/users/brianleejackson/)
 * (@brianleejackson)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/https-and-redirection-issue/#post-7532858)
 * What do you mean when you say the URL reads? Are visitors actually getting redirected
   to that URL?
 * For example, on my site [https://perfmatters.io](https://perfmatters.io), it 
   is running over HTTPS and here is example of one of the cache folders:
 * perfmatters.io/wp-content/cache/cache-enabler/perfmatters.io/png-to-webp/index.
   html
 * The folder after the cache enabler folder won’t have HTTPS on it. That is simply
   the folder in which the cache is stored. Are you saying visitors are actually
   seeing that URL in your browsers?
 * Also, how did you do your .htaccess redirect? Usually the following is sufficient.
 *     ```
       RewriteCond %{SERVER_PORT} 80
       RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R=301,L]
       ```
   
 *  Thread Starter [dccs52](https://wordpress.org/support/users/dccs52/)
 * (@dccs52)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/https-and-redirection-issue/#post-7532868)
 * > What do you mean when you say the URL reads? Are visitors actually getting 
   > redirected to that URL?
 * Yes thats right, if the user accesses the url for example
 * [http://www.mysite.co.uk](http://www.mysite.co.uk) (without the [https://](https://wordpress.org/support/topic/https-and-redirection-issue/?output_format=md))
 * The homepage will load and the user will see the URL:
 * [https://www.mysite.co.uk/wp-content/cache/cache-enabler/www.mysite.co.uk/index.html](https://www.mysite.co.uk/wp-content/cache/cache-enabler/www.mysite.co.uk/index.html)
 * > Also, how did you do your .htaccess redirect? Usually the following is sufficient.
 * Same as yours above
 *     ```
       RewriteCond %{SERVER_PORT} 80
       RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R=301,L]
       ```
   
 *  Thread Starter [dccs52](https://wordpress.org/support/users/dccs52/)
 * (@dccs52)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/https-and-redirection-issue/#post-7532870)
 * and to add this is my current htaccess
 *     ```
       # BEGIN Cache Enabler
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
   
       # set blog sub path
       SetEnvIf Request_URI "^(.*)$" SUB_PATH=/wp-content/cache/cache-enabler/
   
       # set Cache Enabler path
       SetEnvIf Request_URI "^(.*)$" CE_PATH=$1
       SetEnvIf Request_URI "^(/)index.php$" CE_PATH=$1
   
       <IfModule mod_mime.c>
       # webp HTML file
       RewriteCond %{ENV:CE_PATH} /$
       RewriteCond %{ENV:CE_PATH} !^/wp-admin/.*
       RewriteCond %{REQUEST_METHOD} !=POST
       RewriteCond %{QUERY_STRING} =""
       RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
       RewriteCond %{HTTP:Accept-Encoding} gzip
       RewriteCond %{HTTP:Accept} image/webp
       RewriteCond %{DOCUMENT_ROOT}%{ENV:SUB_PATH}%{HTTP_HOST}%{ENV:CE_PATH}index-webp.html.gz -f
       RewriteRule ^(.*) %{ENV:SUB_PATH}%{HTTP_HOST}%{ENV:CE_PATH}index-webp.html.gz [L]
   
       # gzip HTML file
       RewriteCond %{ENV:CE_PATH} /$
       RewriteCond %{ENV:CE_PATH} !^/wp-admin/.*
       RewriteCond %{REQUEST_METHOD} !=POST
       RewriteCond %{QUERY_STRING} =""
       RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
       RewriteCond %{HTTP:Accept-Encoding} gzip
       RewriteCond %{DOCUMENT_ROOT}%{ENV:SUB_PATH}%{HTTP_HOST}%{ENV:CE_PATH}index.html.gz -f
       RewriteRule ^(.*) %{ENV:SUB_PATH}%{HTTP_HOST}%{ENV:CE_PATH}index.html.gz [L]
   
       AddType text/html .gz
       AddEncoding gzip .gz
       </IfModule>
   
       # webp HTML file
       RewriteCond %{ENV:CE_PATH} /$
       RewriteCond %{ENV:CE_PATH} !^/wp-admin/.*
       RewriteCond %{REQUEST_METHOD} !=POST
       RewriteCond %{QUERY_STRING} =""
       RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
       RewriteCond %{HTTP:Accept} image/webp
       RewriteCond %{DOCUMENT_ROOT}%{ENV:SUB_PATH}%{HTTP_HOST}%{ENV:CE_PATH}index-webp.html -f
       RewriteRule ^(.*) %{ENV:SUB_PATH}%{HTTP_HOST}%{ENV:CE_PATH}index-webp.html [L]
   
       # default HTML file
       RewriteCond %{ENV:CE_PATH} /$
       RewriteCond %{ENV:CE_PATH} !^/wp-admin/.*
       RewriteCond %{REQUEST_METHOD} !=POST
       RewriteCond %{QUERY_STRING} =""
       RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
       RewriteCond %{DOCUMENT_ROOT}%{ENV:SUB_PATH}%{HTTP_HOST}%{ENV:CE_PATH}index.html -f
       RewriteRule ^(.*) %{ENV:SUB_PATH}%{HTTP_HOST}%{ENV:CE_PATH}index.html [L]
   
       # wp override
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [END]
       </IfModule>
       # END Cache Enabler
   
       RewriteCond %{SERVER_PORT} 80
       RewriteRule ^(.*)$ https://www.mysite.co.uk/$1 [R=301,L]
   
       # 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
       ```
   
 *  Thread Starter [dccs52](https://wordpress.org/support/users/dccs52/)
 * (@dccs52)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/https-and-redirection-issue/#post-7532938)
 * Hi
 * I managed to resolve this, it was just the order of the HTACCESS, i added the
   cache enabler htaccess code below the default wordpress rewrite and this solved
   my issue.
 *     ```
       RewriteCond %{SERVER_PORT} 80
       RewriteRule ^(.*)$ https://www.mysite.co.uk/$1 [R=301,L]
   
       # 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
   
       # Start Cache Enabler
       <IfModule mod_rewrite.c>
        RewriteEngine On
   
        <IfModule mod_mime.c>
        # webp HTML file
        RewriteCond %{REQUEST_URI} /$
        RewriteCond %{REQUEST_URI} !^/wp-admin/.*
        RewriteCond %{REQUEST_METHOD} !=POST
        RewriteCond %{QUERY_STRING} =""
        RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
        RewriteCond %{HTTP:Accept-Encoding} gzip
        RewriteCond %{HTTP:Accept} image/webp
        RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/cache-enabler/%{HTTP_HOST}%{REQUEST_URI}index-webp.html.gz -f
        RewriteRule ^(.*) /wp-content/cache/cache-enabler/%{HTTP_HOST}%{REQUEST_URI}index-webp.html.gz [L]
   
        # gzip HTML file
        RewriteCond %{REQUEST_URI} /$
        RewriteCond %{REQUEST_URI} !^/wp-admin/.*
        RewriteCond %{REQUEST_METHOD} !=POST
        RewriteCond %{QUERY_STRING} =""
        RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
        RewriteCond %{HTTP:Accept-Encoding} gzip
        RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/cache-enabler/%{HTTP_HOST}%{REQUEST_URI}index.html.gz -f
        RewriteRule ^(.*) /wp-content/cache/cache-enabler/%{HTTP_HOST}%{REQUEST_URI}index.html.gz [L]
   
        AddType text/html .gz
        AddEncoding gzip .gz
        </IfModule>
   
        # default HTML file
        RewriteCond %{REQUEST_URI} /$
        RewriteCond %{REQUEST_URI} !^/wp-admin/.*
        RewriteCond %{REQUEST_METHOD} !=POST
        RewriteCond %{QUERY_STRING} =""
        RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
        RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/cache-enabler/%{HTTP_HOST}%{REQUEST_URI}index.html -f
        RewriteRule ^(.*) /wp-content/cache/cache-enabler/%{HTTP_HOST}%{REQUEST_URI}index.html [L]
       </IfModule>
       # End Cache Enabler
       ```
   
 *  [Brian Jackson](https://wordpress.org/support/users/brianleejackson/)
 * (@brianleejackson)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/https-and-redirection-issue/#post-7532959)
 * Oh ok great. Sorry didn’t have a chance to look at your threads yet. Glad you
   got it resolved!

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

The topic ‘HTTPS and redirection issue’ is closed to new replies.

 * ![](https://ps.w.org/cache-enabler/assets/icon.svg?rev=2442383)
 * [Cache Enabler](https://wordpress.org/plugins/cache-enabler/)
 * [Support Threads](https://wordpress.org/support/plugin/cache-enabler/)
 * [Active Topics](https://wordpress.org/support/plugin/cache-enabler/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cache-enabler/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cache-enabler/reviews/)

## Tags

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

 * 5 replies
 * 2 participants
 * Last reply from: [Brian Jackson](https://wordpress.org/support/users/brianleejackson/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/https-and-redirection-issue/#post-7532959)
 * Status: resolved