WordPress.org

Ready to get started?Download WordPress

Forums

htaccess ignoring directory (2 posts)

  1. wp-leona
    Member
    Posted 3 years ago #

    Hi.
    I have wordpress, with permlinks, and I've got a .htaccess file in the root.
    But I have a secured directory outside of wordpress which displays stats.
    /stats/
    how can I exclude this from the .htaccess file?
    I've searched and tried lots of things, but I either get it so that nothing works, or that I can't get the stats page.
    I've tried.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    # stuff to let through (ignore)
    RewriteCond %{REQUEST_URI} ^/stats/(.*)$
    RewriteRule ^.*$ - [L]#
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    and
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    # stuff to let through (ignore)
    RewriteCond %{REQUEST_URI} !^/(stats|stats/.*)$
    RewriteRule (.*) $1 [L]
    #
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    neither works.

    Any Ideas?

    Leona.

  2. wp-leona
    Member
    Posted 3 years ago #

    Ok seems the problem is with protected directories.

    This is the correct file.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} !^/(stats|stats/.*)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    Which worked fine until I used apache protected dir.
    Then I got a 404 instead of a password dailog.

    Any ideas.

    Leona.

Topic Closed

This topic has been closed to new replies.

About this Topic