WordPress.org

Ready to get started?Download WordPress

Forums

.htaccess interfering with viewing protected, non-WP directories (3 posts)

  1. paulhenrysmith
    Member
    Posted 7 years ago #

    Hi,

    I've got WP 2.1 installed at the top level (example.com) and other non-WP files in other directories, like "stuff/"

    The problem: .htaccess is requiring ./index.php ... preventing access to those non-wp directories. [EDIT: This is only affecting non-wp directories that also have .htaccess protection themselves. ]

    Is there an edit for .htaccess or ./index.php that will fix this? Can this edit be preserved when updating permalinks via the admin interface?

    Thank you in advance, mighty WP users!

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    This only happens in a special circumstance. Namely, when you try to use .htaccess to password protect directories under the WordPress directory.

    The solution:
    1. Create a file on your website. Call it onerror.html. It can have just <html></html> in it for all that it matters. Doesn't matter where it is located.
    2. In WordPress's .htaccess file, add this to the top of the file, before any other lines:
    ErrorDocument 401 /path/to/onerror.html
    ErrorDocument 403 /path/to/onerror.html
    3. There is no three, your problem should now be solved.

    I can explain why this works in greater detail if you're interested, but you're probably not. ;)

  3. wirelessguru
    Member
    Posted 7 years ago #

    I'd like to know more detail.

    That fixed a problem I was having too.

    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic