• Resolved greencode

    (@greencode)


    I use Litespeed on a few sites but only just noticed that it does not work when WordPress is installed in a subdirectory but the site is viewed at root i.e. mysite.som/files is where I have WordPress installed but mysite.com is the site URL.

    At the moment my host has done the following:

    Copy the “# BEGIN LSCACHE … # END LSCACHE” part of “public_html/files/.htaccess”, and paste that into “public_html/.htaccess”. I inserted it before the “# BEGIN WordPress” section, but after the “# Force HTTPS” section.

    Which resolves the issue but if I deactivate and reactivate Litespeed then I’ll have to manually insert this each time.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter greencode

    (@greencode)

    Hi. Just wondering if there’s any news on this and whether you’ll be able to get it working for subdirectory installs? Thanks.

    Plugin Support Cold Egg

    (@eric780217)

    Hi Greencode,

    Pleas check from WordPress official Post here: Giving_WordPress_Its_Own_Directory
    Step 7.
    Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress directory into the root directory of your site (Blog address).
    Step 11.
    If you have set up Permalinks, go to the Permalinks Screen and update your Permalink structure. WordPress will automatically update your .htaccess file if it has the appropriate file permissions. If WordPress can’t write to your .htaccess file, it will display the new rewrite rules to you, which you should manually copy into your .htaccess file (in the same directory as the main index.php file.)

    Are you using Method 2?

    Here are my suggestion methods for this case:
    1. Setup a symbolic link
    or
    2. To avoid using .htaccess under ~/public_html/site/ but parent folder

    Best,
    Eric

    Thread Starter greencode

    (@greencode)

    Thanks for this. I tested this today and it works perfectly. I had been moving the index.php file into the site root and have been doing this for years as this was originally the suggested method by WordPress so I’m not sure when they changed this advice. Anyway, all good and Litespeed is working as expected.

    Thread Starter greencode

    (@greencode)

    Hi. I’d like to revisit this as it’s not working. It does work when you follow Step 7 as you outlined above but whenever WordPress gets updated or plugins get updated then the code you add to the .htaccess to direct WP to your subdirectory install gets overwritten with the regular WP code and then causes a Error 404 on the entire site!

    Thread Starter greencode

    (@greencode)

    Sorry, just to add to this. The only way of using WP in a subdirectory install without WP changing the htaccess file randomly is by using Option 2 (Method II (With URL change)).

    You mentioned

    1. Setup a symbolic link
    or
    2. To avoid using .htaccess under ~/public_html/site/ but parent folder

    Not sure what you mean by either of these. I have tried removing the .htaccess in the subdirectory but that has absolutely no effect and Litespeed still fails to work.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Not working in sub-directory’ is closed to new replies.