• Resolved splitmayo

    (@splitmayo)


    Hello, im facing issues with .htacess; i put a RewriteRule rules in htacess that works, but in matter of hours not work anymore, i thinks its because litespeed creates a .htaccess.bk (backup i think). So how i can avoid this.

Viewing 15 replies - 1 through 15 (of 21 total)
  • Thread Starter splitmayo

    (@splitmayo)

    i have the following code on my .htaccess file:

    <IfModule LiteSpeed>
    CacheLookup on
    RewriteRule .* - [E=Cache-Vary:woocommerce_current_currency]
    </IfModule>
    # BEGIN LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    <IfModule LiteSpeed>
    RewriteEngine on
    CacheLookup on
    RewriteRule .* - [E=Cache-Control:no-autoflush]
    RewriteRule \.object-cache\.ini - [F,L]
    
    ### marker CACHE RESOURCE start ###
    RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
    ### marker CACHE RESOURCE end ###
    
    ### marker FAVICON start ###
    RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
    ### marker FAVICON end ###
    
    ### marker DROPQS start ###
    CacheKeyModify -qs:fbclid
    CacheKeyModify -qs:gclid
    CacheKeyModify -qs:utm*
    CacheKeyModify -qs:_ga
    ### marker DROPQS end ###
    
    </IfModule>
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END LSCACHE

    ?What im doing wrong?

    this is my ticket number:
    KJCFZMMP

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    what rule you put ?

    and what is not working ?

    Best regards,

    Thread Starter splitmayo

    (@splitmayo)

    this rule i put:
    RewriteRule .* - [E=Cache-Vary:woocommerce_current_currency]

    it caches the whole page.
    its supposed that code will exclude the cache for a price based in geolocation, for example if you access to the page in chile, you will see the price in CLP. but if you access from europe, or argentina, you will se the price in USD.

    and this is not working. what im doing wrong?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    no

    RewriteRule .* – [E=Cache-Vary:woocommerce_current_currency]

    this rule is VARY the cache , not to make it no cache

    I replied this question on other topic you made

    Best regards

    Thread Starter splitmayo

    (@splitmayo)

    So, does the cache vary according to geolocation?

    why is not working in my case?

    there is a rewriterule tat excludes from cache?

    thanks a lot for your support

    Plugin Support qtwrk

    (@qtwrk)

    this rule only works when something is setting that cookie on the fly , if it doesn’t set cookie beforehand , it won’t work

    for geo vary , it is better to use this approach

    Thread Starter splitmayo

    (@splitmayo)

    so, for ggeo vary the code for htaccess will look like this? its correct?

    <IfModule LiteSpeed>
      RewriteEngine on
      CacheLookup on
      RewriteRule .* - [E=Cache-Control:vary=%{ENV:GEO_COUNTRY}]
      RewriteRule .* - [E=Cache-Vary:woocommerce_current_currency]
    </IfModule>

    thanks in advance

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    you need to first create a phpinfo page, to get correct Geo env name

    e.g. in my test server, I have it as below

    so I use RewriteRule .* - [E=Cache-Control:vary=%{ENV:GEOIP_COUNTRY_CODE}]

    Best regards,

    Thread Starter splitmayo

    (@splitmayo)

    there is an alternative way? i dont have the knowledge and the permissons for that :(, im in a shared hosting enviroment.

    thanks for your reply

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    only other way around is to put CloudFlare

    CF also provides a country code in header

    to make it

    RewriteRule .* - [E=Cache-Control:vary=%{HTTP:CF-IPCountry}]

    Best regards,

    Thread Starter splitmayo

    (@splitmayo)

    Not working for me ?? , im doing something wrong?

    <IfModule LiteSpeed>
    RewriteEngine on
    RewriteRule .* - [E=Cache-Control:vary=%{HTTP:CF-IPCountry}]
    </IfModule>
    # BEGIN LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##

    i need to do some config in cloudflare?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    you need to have CloudFlare CDN enabled in order to use this one

    Best regards,

    Thread Starter splitmayo

    (@splitmayo)

    i have cloudflare enabled and linked with litespeed plugin, the rules is not working, i think is beacause there is not a “CF-IPCountry ” name and value in the headers? if all where fine, i will find this value in headers ? (CF-IPCountry)

    Plugin Support qtwrk

    (@qtwrk)

    you can create a phpinfo page to verify if you get that header

    Thread Starter splitmayo

    (@splitmayo)

    i created the phpinfo, and enabled a module geoip, and only get this:

    https://ibb.co/19JN63D

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘issues with htaccess’ is closed to new replies.