Find the answer to your Linux question:
Results 1 to 2 of 2
I've got a website with a wordpress installation on it, and I'm trying to install learn with texts ( Learning with Texts :: Help/Information ) in a sub directory /lwt/. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Enthusiast
    Join Date
    Apr 2004
    Location
    UK
    Posts
    678

    Wordpress doesn't play nice


    I've got a website with a wordpress installation on it, and I'm trying to install learn with texts (Learning with Texts :: Help/Information) in a sub directory /lwt/.

    The problem comes about when I password protect the sub directory. When I try to open it I get a 404 status with the WWW-authenticate header. Or I get a 301 status when I try to access /lwt/index.php which bounces me to /lwt/. Then Wordpress steps in with it's 404 page which means I don't get a chance to enter the password.

    The only way around it so far is to rename the for wordpress .htaccess file in the root dir, access /lwt/ which then correctly requests the password and once I'm logged in I can put the .htaccess back and carry on. Clearly not ideal.

    Any help you guys can offer would be much appreciated. My .htaccess files are as follows:

    root dir .htaccess
    Code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    lwt .htaccess
    Code:
    AuthType Basic
    AuthName "lwt"
    AuthUserFile "/home/<snip>/.htpasswds/public_html/lwt/passwd"
    require valid-user
    Thanks for your help.

    Chris
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

  2. #2
    Linux Enthusiast
    Join Date
    Apr 2004
    Location
    UK
    Posts
    678

    [solved] Wordpress doesn't play nice

    I have solved this with further googling. It is entirely cargo-cult because I'm not sure exactly how Apache and htaccess hangs together, but it seems I need to specify the error document in the subdirectory.

    The new version is:
    Code:
    AuthType Basic
    AuthName "lwt"
    AuthUserFile "/home/<snip>/.htpasswds/public_html/lwt/passwd"
    require valid-user
    ErrorDocument 401 "Authorisation Required
    It now requests the password correctly and I can get into learn with texts. If someone can post a better explanation of *why* this works then that'd be greatly appreciated, but it now works for me.

    Thanks.
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •