.htaccess and wordpress

Discussion in 'Server Operation' started by KenKnight, Feb 25, 2014.

  1. KenKnight

    KenKnight Member

    Hi all,

    Ok I'm pretty much at my wits end with this stupid server and it's configuration. Here's what's happening; I have several virtual sites on this server that are hosting wordpress. On 1 of these sites I cannot access the /stats URL. On all the rest I can. This site is using the stock wordpress .htaccess in the web root and wordpress is installed at the web root. If I rename the .htaccess to something else I can access the stats directory just fine. The odd part is, the stats directory is the only site that gets passed on through to the wordpress index.php and generates an wp 404 error.

    I've compared the vhosts file between the one that works and the one that doesn't and they are pretty much identical with the exception of paths.

    Here is the .htaccess from the site with issues:

    <IfModule mod_rewrite.c>
    RewriteEngine On  
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    Correct me if I'm wrong, but tha the -d line should return false and the rewrite rule should not be implemented. I've also tried putting:
    RewriteCond %{REQUEST_URI} !^/(stats|stats/.*)
    above the -f line. and I've tried modifying the rewrite rule to be as follows:

    RewriteRule ./ /index.php [L]
    And nothing seems to work. It has to be the .htaccess as removing it makes the stats directory available. Any suggestions?

  2. KenKnight

    KenKnight Member

    To anyone else that encounters this, I got it figured out. The password protected stats directory is issuing a 401 response and wordpress is catching that. By adding:

    ErrorDocument 401 default

    to the beginning of my .htacccess file corrected the problem.


Share This Page