Support » Installation » htaccess doesn’t work when WP installed

htaccess doesn’t work when WP installed

  • 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?

Viewing 7 replies - 1 through 7 (of 7 total)
  • And this htaccess file is not in a folder-level above the wordpress one?

    The folder is just in the root of the website.

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

    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.

    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.


    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..

    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.

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘htaccess doesn’t work when WP installed’ is closed to new replies.