• I have a subfolder on my server, named “what”, which is passworded using .htaccess/.htpasswd. If I attempt to view this folder, I am instead forwarded to my WordPress (2.0) installation, rather than being presented with a login box as expected.

    See what I mean: https://beoba.net/what

    If I remove WP’s .htaccess, the folder is viewable, but WP permalinks become broken. What can I do to WP’s .htaccess to make this folder act correctly, but still keep the permalinks? It is currently set to the WP defaults:

    –START WP’S .HTACCESS–
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php
    </IfModule>

    # END WordPress
    –END WP’S .HTACCESS–

    I tried adding “RewriteCond %{REQUEST_URL} !^what” as well as “RewriteCond %{REQUEST_URL} !^/what” to the above file, but neither of them did anything whatsoever.

Viewing 6 replies - 1 through 6 (of 6 total)
  • It shouldn’t be touching that directory anyway, the second line says “if it’s not a directory”. Can you confirm that /what is a directory on your server? It doesn’t seem so because usually /what would redirect to /what/.

    Thread Starter beoba

    (@beoba)

    It most certainly is. Here are the (relevant) contents of the root directory for beoba.net:

    -rw-rw-r– 1 beoba pg154859 235 2006-01-03 23:39 .htaccess
    -rwxr-xr-x 1 beoba pg154859 99 2005-02-19 00:10 index.php
    drwxrwxr-x 2 beoba pg154859 4096 2006-01-03 23:33 what
    lrwxrwxrwx 1 beoba pg154859 3 2005-12-31 02:39 wp -> wp2
    drwxr-xr-x 6 beoba pg154859 4096 2005-09-18 15:37 wp152
    drwxr-xr-x 5 beoba pg154859 4096 2005-12-31 02:52 wp2

    index.php has an include for “./wp/wp-blog-header.php”

    Thread Starter beoba

    (@beoba)

    Something weird is that if I remove/rename the .htaccess file, log in to /what, and then readd/rename it back, I am then able to view the folder (apparently being logged in makes it viewable despite .htaccess being there).

    Hello,

    I had the same problem and I fixed it by changing
    the line that reads:

    RewriteRule . /index.php

    to read:

    RewriteRule .+ /index.php

    My regex is a little rusty, but that seemed to do the trick for me.

    @matt: The reason the subdirectory is effected by the .htaccess in the wordpress directory is that every subdirectory inherits its parent’s .htaccess

    Thread Starter beoba

    (@beoba)

    Still acting the same for me, current contents of .htaccess:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .+ /index.php
    </IfModule>

    And the contents of /what’s .htaccess (though even if these were wrong, it would give a 500 error rather than WP’s current “takeover by default” action):

    AuthUserFile /home/beoba/beoba.net/what/.htpasswd
    AuthName “PASSWORDED”
    AuthType Basic

    <Limit GET POST>
    require valid-user
    </Limit>

    Contents of /what’s .htpasswd:

    what:W.Mas09m6gatg

    I believe this issue is solved; please see my post at the bottom of https://www.ads-software.com/support/topic/55033?replies=6

    I had the same issue, but I think everything works now!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘bug with wp2’s .htaccess?: subfolders with htaccess/htpassword are unviewable’ is closed to new replies.