Title: %{HTTPS} =on syntax is wrong for some servers
Last modified: June 12, 2025

---

# %{HTTPS} =on syntax is wrong for some servers

 *  [Bogdan](https://wordpress.org/support/users/polyghost/)
 * (@polyghost)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/https-on-syntax-is-wrong-for-some-servers/)
 * Hello, I have a client using the plugin, and no matter what combination of settings
   we tried, the pages were just never cached (I checked the end of the page markup
   for that comment which is proof of caching). I checked the changes it did to .
   htaccess and it seems like there is a potential bug in the code, specifically
   in the `prefixRedirect` function from inc/admin.php:
 *     ```wp-block-code
       $forceTo = "\nRewriteCond %{HTTPS} =on"."\n"
       ```
   
 * should be:
 *     ```wp-block-code
       $forceTo = "\nRewriteCond %{HTTPS} on"."\n".
       ```
   
 * ChatGPT explains it very clearly:
 * This is **incorrect usage** in Apache. It **does not evaluate** the way the plugin
   author thinks.
    - Apache sets `HTTPS` to `"on"` **only if SSL is active**, but using `=on` **
      makes the rewrite condition true only when HTTPS is _exactly_ equal to “on”**,
      which isn’t how it should be checked in `.htaccess`.
    - Worse, **mod_rewrite expects a regex**, so `=on` is not interpreted reliably
      across servers.
 * ✅ Correct Usage:
 * Replace:
 *     ```wp-block-code
       RewriteCond %{HTTPS} =on
       ```
   
 * With:
 *     ```wp-block-code
       RewriteCond %{HTTPS} on
       ```
   
 * I made that change and now the pages are cached. Could you please include this
   fix in the next releases, so we don’t have to keep manually modify that line 
   after each update? My client also has the paid version of the plugin.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhttps-on-syntax-is-wrong-for-some-servers%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Emre Vona](https://wordpress.org/support/users/emrevona/)
 * (@emrevona)
 * [11 months, 1 week ago](https://wordpress.org/support/topic/https-on-syntax-is-wrong-for-some-servers/#post-18513003)
 * thank you so much. I will fix it and let you know.
 *  Plugin Author [Emre Vona](https://wordpress.org/support/users/emrevona/)
 * (@emrevona)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/https-on-syntax-is-wrong-for-some-servers/#post-18552227)
 * I fixed the problem. Can you download the following version to get the latest
   changes please?
 * [https://downloads.wordpress.org/plugin/wp-fastest-cache.zip](https://downloads.wordpress.org/plugin/wp-fastest-cache.zip)

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

The topic ‘%{HTTPS} =on syntax is wrong for some servers’ is closed to new replies.

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

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [Emre Vona](https://wordpress.org/support/users/emrevona/)
 * Last activity: [10 months, 2 weeks ago](https://wordpress.org/support/topic/https-on-syntax-is-wrong-for-some-servers/#post-18552227)
 * Status: not resolved