htaccess doesn't work when WP installed (8 posts)

  1. nieuws
    Posted 9 years ago #

    I want to protect a part of the server with .htaccess. The area i want to protect has nothing to do with WordPress, but when i upload a htaccess file in the specified folder, again completely outside WordPress, i get a 404 not found error.

    When WordPress is not installed on the server i have no problem with htaccess per folder.

    What should i do to solve this problem?

  2. OnSeduction
    Posted 9 years ago #

    And this htaccess file is not in a folder-level above the wordpress one?

  3. nieuws
    Posted 9 years ago #

    The folder is just in the root of the website.

    For example:
    [ wp-content ]
    [ wp-includes ]
    [ wp-admin ]
    [ protected ] .htacces & content

  4. geoffe
    Posted 9 years ago #

    so what do you have in that bottom file, the .htaccess in the site root?

    It will have an effect on subdirectories that you'll need to negate.

    You should seek help on understanding htaccess, not WordPress, to find help on this. What you want to have is a htaccess RewriteCond conditional rule, that excepts your [ protected ] directory from forcing everything to WP, which is what I presume is happening.

  5. nieuws
    Posted 9 years ago #

    This is the exact htaccess file generated by WordPress. I haven't altered anything. This is the current file in the root as described in my previous post.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    What i want to work is that
    url/restrictedarea/ can use a htaccess password file. It can't now because then i get a 404 not found error.

    This is what the htaccess in /restricedarea/ looks like:

    #BEGIN RestrictedArea
    AuthName "Content Editor Protected Area"
    AuthType Basic
    AuthUserFile /path/restrictedarea/.htpasswd
    Require valid-user
    #END RestrictedArea

    Path is ofcoarse the correct serverpath to the htpasswd file that is located within the same folder.

  6. nieuws
    Posted 9 years ago #


    According my serveradmin the httaccess in the root (generated by wordpress) is also automatically read in subfolders. Without the wordpress file it works like a charm, but with (and i need it for the names) i get 404 errors..

  7. geoffe
    Posted 9 years ago #

    If it comforts you at all, I found a similar problem here: http://www.issociate.de/board/post/190669/mod_rewrite_conflicting_with_htpasswd_protection.html

    WordPress forums really aren't the greatest for these types of issues.

    Your options appear to be to make a subdomain to get a safe address for user authentication or to move your blog (and hence, the URL rewriting) out of the site root to avoid the conflict.

  8. nieuws
    Posted 9 years ago #

    Thank you Geoffe that appears to work. However iam running a CMS next to WordPress. If iam using the subdomain forward it has some trouble finding all the correct folders again. I can change that ofcoarse but perhaps it would be easier to just use another password system. Do you perhaps have any suggestion for a quality but easy password protection system? Such as htaccess but then ofcoarse something else.

Topic Closed

This topic has been closed to new replies.

About this Topic