• Resolved webdevbytes

    (@webdevbytes)


    I have enabled ESI but the following instructions are not added to the .htaccess

    RewriteRule .* - [E=esi_on:1]
    RewriteRule .* - [E=cache-control:max-age=120]

    If I add code manually outside of “Do no edit” zone added by plugin, ESI is not activated.

    <IfModule LiteSpeed>
    RewriteRule .* - [E=esi_on:1]
    RewriteRule .* - [E=cache-control:max-age=120]
    <IfModule>

    If I add code manually inside the “Do no edit” zone, it works but gets overwritten if Litespeed plugin settings are saved.

    # 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 ^min/\w+\.(css|js) - [E=cache-control:no-vary]
    RewriteRule .* - [E=esi_on:1]
    RewriteRule .* - [E=cache-control:max-age=120]
    ### marker CACHE RESOURCE start ###
    RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
    ### marker CACHE RESOURCE end ###
    </IfModule>
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END LSCACHE

    Any recommendations?

    • This topic was modified 5 years, 1 month ago by webdevbytes.
    • This topic was modified 5 years, 1 month ago by webdevbytes.
Viewing 1 replies (of 1 total)
  • Thread Starter webdevbytes

    (@webdevbytes)

    It works if

    <IfModule LiteSpeed>
    RewriteRule .* - [E=esi_on:1]
    RewriteRule .* - [E=cache-control:max-age=120]
    <IfModule>

    is added before the instructions added by the plugin.

    • This reply was modified 5 years, 1 month ago by webdevbytes.
Viewing 1 replies (of 1 total)
  • The topic ‘ESI rewrite rule in htaccess not working’ is closed to new replies.