• Resolved sallymoos

    (@sallymoos)


    Hi,

    I’m new to Litespeed Cache and I’m using it on a Litespeed server with CPanel. Very happy with it so far but couple issues ..

    1. If WordPress is installed in its own folder, then LS updates the .htaccess in that folder, but not the one in public_html. Is this the correct behaviour? I find I have to copy the whole “# BEGIN LSCACHE” section into my public_html .htaccess file to get it working.

    2. I noticed that if I choose to Minify/Combine/HTTP/2Push CSS/JS in the plugin settings, it doesn’t change the LSCACHE section in any htaccess. Can anyone explain how the site then knows whether to use Minify/Combine/HTTP/2Push CSS/JS?

    Thanks,

    Sal.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Could you please specify more about your site structure ?

    You mean , you have a site in /sub-directory , while use .htaccess to redirect it to become https://www.domain.com instead of https://www.domain.com/sub-directory ?

    Best regards,

    • This reply was modified 5 years, 6 months ago by qtwrk.
    Thread Starter sallymoos

    (@sallymoos)

    Hi,

    Thanks for our reply. ??

    The site is https://www.domain.com but wordpress is installed in https://www.domain.com/wordpress

    My index.php file in public thus says …

    /** Loads the WordPress Environment and Template */
    require( dirname( __FILE__ ) . ‘/wordpress/wp-blog-header.php’ );

    The htaccess file in /wordpress is being updated when I activate LS, but the htaccess file in public_html is not. I have to C&P the LS code into that one.

    Any feedback re Q2 above?

    Thanks.

    • This reply was modified 5 years, 6 months ago by sallymoos.
    • This reply was modified 5 years, 6 months ago by sallymoos.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    I am not sure , I will run some test and get back to you.

    Could you please confirm that you were using this method to do so ?

    If not , please provide the method that you did to make this structure so I can reproduce and check the issue.

    Best regards,

    Thread Starter sallymoos

    (@sallymoos)

    Hi,

    Yes, I used Method II. Site has been running this way for years.

    Ta.

    S.

    1. If WordPress is installed in its own folder, then LS updates the .htaccess in that folder, but not the one in public_html. Is this the correct behaviour?

    To get LsCache to work with WordPress in a subdirectory, all you need is this in your htaccess (placed before the # BEGIN WordPress rules).

    <IfModule LiteSpeed>
    CacheLookup public /
    </IfModule>

    2. I noticed that if I choose to Minify/Combine/HTTP/2Push CSS/JS in the plugin settings, it doesn’t change the LSCACHE section in any htaccess.

    Not sure if it’s due to an issue with your configuration, but I see the following rules in my htaccess (in the WordPress subfolder).

    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    ### marker MINIFY start ###
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} ^(.*)/min/(\w+)\.(css|js)$
    RewriteCond %1/wp-content/cache/$2/$1.$2 -f
    RewriteRule min/(\w+)\.(css|js) wp-content/cache/$2/$1.$2 [L]
    </IfModule>
    ### marker MINIFY end ###
    Thread Starter sallymoos

    (@sallymoos)

    Thanks for your reply @luminsol

    1. I added these lines to the .htaccess in public_html on a new site and activated LS Cache, but it didn’t work. The LS code was aded to the .htaccess in /wordpress OK, but checking the home page site headers showed “x-litespeed-cache: miss” after refreshing several times. When I copied the LS lines to the htaccess in public_html (as I have been doing), this changed to “x-litespeed-cache: hit,private” straightaway after refreshed the page.

    2. I understand and I have these lines in my .htaccess too, but my question was how doe the site know whether I have chosen to Minify/Combine/HTTP/2Push CSS/JS in the plugin settings?

    Sal.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    my question was how doe the site know whether I have chosen to Minify/Combine/HTTP/2Push CSS/JS in the plugin settings?

    The rewrite rule are used to mask /wp-content/cache/css/xxxxx.css to /min/xxxxx.css

    Ultimately it’s controlled by PHP, LSCWP will check its setting in databse to determinate whether you have enable such function or not.

    Best regards,

    Thread Starter sallymoos

    (@sallymoos)

    @qtwrk

    OK, thanks, I Understand.

    Sal.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    I can see that .htaccess issue you mentioned , will have to talk with devs about it.

    Please use your temporarily solution for the time being.

    Best regards,

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘LS not updating htaccess in public_html’ is closed to new replies.