• Resolved joy0114

    (@joy0114)


    Hi,

    As I hear a lot of good things about the “guest mode” feature, I wanted to try it.

    But I have some problems.

    After purging the cache, if I activate guest mode, I see inside console:

    /wp-content/ajouts/litespeed-cache/guest.vary.php error 404

    However, my ftp shows me this file, in this directory, with permissions 644

    and

    Uncaught (in promise) SyntaxError: Unexpected token ‘<‘, “<!DOCTYPE “… is not valid JSON

    wp-config.php contains:
    define(‘LSCWP_DIR’, ‘/all-my-folders/wp-content/ajouts/litespeed-cache/’);

    And, in GUI, “Test of guest mode” seems failed … as we can see on screenshot.
    gui guest mode

    It’s specified that enabling guest mode, impacts htaccess file.
    However my htaccess has not changed, even if I have momentarily changed its permissions so that it was writable when I enabled guest mode.

    Thanks a lot for any ideas.
    Best regards

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • define(‘LSCWP_DIR’, ‘/all-my-folders/wp-content/ajouts/litespeed-cache/’);

    Did you add this code?

    Thread Starter joy0114

    (@joy0114)

    Hi serpentdriver,

    No … The right one. Litespeed plugin does the work.
    As a matter of fact, it does not come from this. Problem is between keyboard and seat.

    I just notice it comes from lines in htaccess, in order to protect access to php files:

    
    <IfModule mod_rewrite.c>
    RewriteRule wp-content/ajouts/(.*\.php)$ - [R=404,L]
    

    So I tried to add, previous this line (even if order is not important), this code:
    RewriteCond %{REQUEST_URI} !^/wp-content/ajouts/litespeed-cache/guest.vary\.php$

    In order to exclude guest.vary.php

    But It does not work.

    I’m quite sure it comes from this. If you have an idea …
    Thanks !

    Please undo (remove) this code:

    define(‘LSCWP_DIR’, ‘/all-my-folders/wp-content/ajouts/litespeed-cache/’);

    Constant LSCWP_DIR is already defined. A constant can’t be overwritten by another constant for LSCWP_DIR.

    And also remove this code:

    RewriteCond %{REQUEST_URI} !^/wp-content/ajouts/litespeed-cache/guest.vary\.php$

    • This reply was modified 1 year, 11 months ago by serpentdriver.
    Thread Starter joy0114

    (@joy0114)

    To be more precise, this configuration of LSCWP_DIR comes from this topic (I’ve tried guest mode for long time ago…):
    https://www.ads-software.com/support/topic/404-error-with-guest-vary-php/

    Well, I removed it, and I commented all this block:

    # bloque  l'accès aux fichiers .php des dossiers theme et plugins 
    # exclusion de fichier et répertoire sur les 2 premières lignes : 
    #<IfModule mod_rewrite.c>
    #RewriteCond %{REQUEST_URI} !^/wp-content/ajouts/litespeed-cache/guest\.vary\.php
    #RewriteCond %{REQUEST_URI} !^/wp-content/plugins/directory/to/exclude/
    #RewriteRule wp-content/ajouts/(.*\.php)$ - [R=404,L]
    #</IfModule>

    I purged all, ans same result:
    POST https://lesbijouxdelhermine.fr/wp-content/ajouts/litespeed-cache/guest.vary.php 404
    and
    Uncaught (in promise) SyntaxError: Unexpected token ‘<‘, “<!DOCTYPE “… is not valid JSON

    It is indicated in the gui of the litespeed plugin that htaccess is modified when guest mode is activated.
    What line(s) are added?

    I use 7G FIREWALL from https://perishablepress.com/7g-firewall/
    which adds some rules to htaccess in order to secure the website.

    I commented the only line which contains “guest” (and replace the same without “guest”:

    #	RewriteCond %{REQUEST_URI} (/%7e)(root|ftp|bin|nobody|named|guest|logs|sshd)(/) [NC,OR]
    RewriteCond %{REQUEST_URI} (/%7e)(root|ftp|bin|nobody|named|logs|sshd)(/) [NC,OR]
    RewriteRule .* - [F,L]

    I’m going to make a test with an htaccess without 7G firewall.

    Thread Starter joy0114

    (@joy0114)

    I deleted all lines of 7G Firewall, same result: guest.vary.php in error 404 , while it exists.

    Could the method used be the cause of the problem (POST vs GET)?

    It is indicated in the gui of the litespeed plugin that htaccess is modified when guest mode is activated.
    What line(s) are added?

    Cache plugin only adds rewrite rules for cache vary. This rule has no influence in your issue.

    A 404 error means that the requested source could not be found at the specified URL. You’ve made some custom modifications to your server that can’t be reproduced from the outside, so finding the cause can only be solved by yourself.

    Thread Starter joy0114

    (@joy0114)

    Hi serpentdriver,

    You’re right …. as usual …!

    I finally found the problem: an htaccess that was a little too “tight”. So now I can test the guest mode… and perhaps having some questions …

    Thanks for your support ! We are sometimes alone, but supported. That’s important.

    Best regards

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Guest mode issue’ is closed to new replies.