Title: .htaccess redirect code issue?
Last modified: June 23, 2025

---

# .htaccess redirect code issue?

 *  Resolved [hansnielsen](https://wordpress.org/support/users/hansnielsen/)
 * (@hansnielsen)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/)
 * Hello,
 * The redirect code that is placed in my .htaccess file by the Really Simple Security
   plugin seems to be causing issues with my cache plugin. All pages and posts (
   except the homepage) on my site are being blocklisted from cache warmup in the
   cache plugin, and the cache plugin support staff believes it has to do with the.
   htaccess redirect code.
 * This is the code added to my .htaccess file:
 *     ```wp-block-code
       #Begin Really Simple Security<IfModule mod_rewrite.c>RewriteEngine onRewriteCond %{HTTP:X-Forwarded-Proto} !httpsRewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]</IfModule>Options -Indexes#End Really Simple Security
       ```
   
 * Is this the correct code? I do not recognize this part of the code:
 *     ```wp-block-code
       RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
       ```
   
 * Has that part of the code been there before? Or has something changed during 
   a plugin update?
 * Thanks!

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

1 [2](https://wordpress.org/support/topic/htaccess-redirect-code-issue/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/htaccess-redirect-code-issue/page/2/?output_format=md)

 *  Plugin Support [Jarno Vos](https://wordpress.org/support/users/jarnovos/)
 * (@jarnovos)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18523883)
 * Hi [@hansnielsen](https://wordpress.org/support/users/hansnielsen/),
 * This is indeed the correct code, the line you attached has indeed been part of
   the plugin for a long time (specifically since the introduction of the _Let’s
   Encrypt Wizard_, which has been there for years).
 * This line basically just means, “do not apply the redirect to requests for `/.
   well-known/acme-challenge/`, which is done because that specific path is used
   by Let’s Encrypt during the process of automated SSL/TLS certificate issuance(
   or renewal).
 * While I wouldn’t initially suspect a mere 301 redirect to `https://` in the `.
   htaccess` to cause cache issues similar to what you described, I suppose you 
   could try ruling it out as being related by temporarily removing them and checking
   if the cache issue persists upon doing so.
 * If this behavior does persist even though the rules aren’t there anymore, there’s
   likely something else at play here.
 * Kind regards, Jarno
 *  Thread Starter [hansnielsen](https://wordpress.org/support/users/hansnielsen/)
 * (@hansnielsen)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18524016)
 * Hello [@jarnovos](https://wordpress.org/support/users/jarnovos/) and thank you
   for your quick reply.
 * When I disabled redirect in Really Simple Security > Settings > SSL (which removed
   the code from .htaccess), the issue was not there anymore, and the cache warmup
   was working again without blocklisting any pages or posts.
 * Where do I go from here?
 * Thank you!
 *  Plugin Support [Jarno Vos](https://wordpress.org/support/users/jarnovos/)
 * (@jarnovos)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18524023)
 * Hi [@hansnielsen](https://wordpress.org/support/users/hansnielsen/),
 * If your cache plugin doesn’t behave well in combination with the **.htaccess 
   301 redirect**, you could try switching to the standard **WordPress PHP redirect**
   via the plugin’s settings _(Security -> Settings -> SSL -> Redirect Method)_ 
   instead.
 * Kind regards, Jarno
 *  Thread Starter [hansnielsen](https://wordpress.org/support/users/hansnielsen/)
 * (@hansnielsen)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18524054)
 * Hi [@jarnovos](https://wordpress.org/support/users/jarnovos/)
 * Yes, that worked.
 * Can you please confirm that there has been no changes to the Really Simple Security.
   htaccess redirect code? I am asking because the issue with the cache plugin has
   not been there before (= the cache plugin has been working fine with the .htaccess
   redirect code earlier), so I need to know which info I shall give to the cache
   plugin staff.
 * Thank you.
 *  Plugin Support [Jarno Vos](https://wordpress.org/support/users/jarnovos/)
 * (@jarnovos)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18524200)
 * Hi [@hansnielsen](https://wordpress.org/support/users/hansnielsen/),
 * Indeed, the .htaccess 301 redirect hasn’t changed in recent versions of the plugin;
   so I can’t really say how that would have changed the caching plugin behavior
   in the meantime (provided that this is the only difference).
 * The WordPress 301 redirect is a perfectly fine alternative though, so it’d be
   fine to just use that instead.
 * Kind regards, Jarno
    -  This reply was modified 11 months, 2 weeks ago by [Jarno Vos](https://wordpress.org/support/users/jarnovos/).
 *  Thread Starter [hansnielsen](https://wordpress.org/support/users/hansnielsen/)
 * (@hansnielsen)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18524256)
 * Great, thank you [@jarnovos](https://wordpress.org/support/users/jarnovos/)
 *  [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18524491)
 * Hello,
 * LiteSpeed support staff here as requested by the user to explain the issue 🙂
 * the issue is
 * > RewriteCond %{HTTP:X-Forwarded-Proto} !https
 * this condition , it works fine when site is running behind proxy or CDN, the 
   proxy server will send `XFP: https` header , but in our case, our crawler will
   send request directly to the origin server , bypass CDN/proxy , as this is a 
   direct connection to the origin server, it does not carry the `XFP: https` header,
   thus hit the rule that makes redirection and breaks our function.
 * I am not exactly sure how to fix this , offhanded , few thoughts :
    1. add a rule to check if a proxy exists , and only check the xfp if proxy exists
    2. add a whitelist rule to bypass our crawler user agent (LSCache runner)
    3. add a rule to bypass the request sending from server IP itself ( it might be
       hard to determine which IP sends the request if server contains multiple IPs
       which is fairly common on shared hosting server )
 *  -  This reply was modified 11 months, 2 weeks ago by [qtwrk](https://wordpress.org/support/users/qtwrk/).
 *  Plugin Support [Jarno Vos](https://wordpress.org/support/users/jarnovos/)
 * (@jarnovos)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18524508)
 * Hi [@qtwrk](https://wordpress.org/support/users/qtwrk/),
 * I highly appreciate your input here, thanks a lot for chiming in.
 * I will put this case up for discussion within our development team to see how
   we could best address such a situation, but your insights are very much appreciated.
 * For the time being though, I expect that the user is best served by reverting
   to the standard 301 WordPress PHP redirect as this will be an immediate solution
   to their problem.
 * Kind regards, Jarno
 *  [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18524522)
 * thanks 🙂
 *  [pzsniper](https://wordpress.org/support/users/pzsniper/)
 * (@pzsniper)
 * [10 months, 3 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18563229)
 * Same issue
 * [Lite Speed Cache Crawler ISSUES with Really Simple Security 9.4.2 | WordPress.org](https://wordpress.org/support/topic/lite-speed-cache-crawler-issues-with-really-simple-security-9-4-2/#post-18563228)
 *  Thread Starter [hansnielsen](https://wordpress.org/support/users/hansnielsen/)
 * (@hansnielsen)
 * [10 months, 3 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18563235)
 * Hello [@pzsniper](https://wordpress.org/support/users/pzsniper/) and [@qtwrk](https://wordpress.org/support/users/qtwrk/)
 * I actually removed the Really Simple Security plugin, but the issue was still
   there. Then reinstalled Really Simple Security again.
 * Maybe it happens a bit less often without the Really Simple Security plugin, 
   but still there when removing the plugin. I have to try many times with clearing
   caches, clearing block lists, reloading sitemap, and after a while it works…
 *  Plugin Support [Jarno Vos](https://wordpress.org/support/users/jarnovos/)
 * (@jarnovos)
 * [10 months, 3 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18564142)
 * Hi [@hansnielsen](https://wordpress.org/support/users/hansnielsen/)
 * FYI, we have a fix for this case planned for the next release of the plugin, 
   which will exclude the LSCache Crawler from the redirect in Really Simple Security.
 * Kind regards, Jarno
 *  Thread Starter [hansnielsen](https://wordpress.org/support/users/hansnielsen/)
 * (@hansnielsen)
 * [10 months, 3 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18564339)
 * That is great, thank you [@jarnovos](https://wordpress.org/support/users/jarnovos/)
 *  Plugin Support [Jarno Vos](https://wordpress.org/support/users/jarnovos/)
 * (@jarnovos)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18567361)
 * Hi [@hansnielsen](https://wordpress.org/support/users/hansnielsen/) (cc [@pzsniper](https://wordpress.org/support/users/pzsniper/)
   and [@qtwrk](https://wordpress.org/support/users/qtwrk/)),
 * I need to correct my previous message: the fix to exclude the LSCache Crawler
   from the redirect will not be included in the next release as initially planned,
   but it is scheduled for the release _after_ that.
 * Sorry about that!
 * Kind regards, Jarno
 *  [pzsniper](https://wordpress.org/support/users/pzsniper/)
 * (@pzsniper)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/#post-18584589)
 * Hi,
   Is the latest 9.4.3 finally the fixer for this BIG issue?[https://prnt.sc/duPmx8NREEd9](https://prnt.sc/duPmx8NREEd9)
    -  This reply was modified 10 months, 1 week ago by [pzsniper](https://wordpress.org/support/users/pzsniper/).

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

1 [2](https://wordpress.org/support/topic/htaccess-redirect-code-issue/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/htaccess-redirect-code-issue/page/2/?output_format=md)

The topic ‘.htaccess redirect code issue?’ is closed to new replies.

 * ![](https://ps.w.org/really-simple-ssl/assets/icon-256x256.png?rev=2839720)
 * [Really Simple Security - Simple and Performant Security (formerly Really Simple SSL)](https://wordpress.org/plugins/really-simple-ssl/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/really-simple-ssl/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/really-simple-ssl/)
 * [Active Topics](https://wordpress.org/support/plugin/really-simple-ssl/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/really-simple-ssl/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/really-simple-ssl/reviews/)

## Tags

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

 * 16 replies
 * 4 participants
 * Last reply from: [Jarno Vos](https://wordpress.org/support/users/jarnovos/)
 * Last activity: [10 months, 1 week ago](https://wordpress.org/support/topic/htaccess-redirect-code-issue/page/2/#post-18584610)
 * Status: resolved