Title: htaccess doesn&#8217;t work when WP installed
Last modified: August 18, 2016

---

# htaccess doesn’t work when WP installed

 *  [nieuws](https://wordpress.org/support/users/nieuws/)
 * (@nieuws)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/htaccess-doesnt-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)

 *  [onseduction](https://wordpress.org/support/users/onseduction/)
 * (@onseduction)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/htaccess-doesnt-work-when-wp-installed/#post-424269)
 * And this htaccess file is not in a folder-level above the wordpress one?
 *  Thread Starter [nieuws](https://wordpress.org/support/users/nieuws/)
 * (@nieuws)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/htaccess-doesnt-work-when-wp-installed/#post-424353)
 * The folder is just in the root of the website.
 * For example:
    [ wp-content ] [ wp-includes ] [ wp-admin ] [ protected ] .htacces&
   content index.php .htaccess
 *  [geoffe](https://wordpress.org/support/users/geoffe/)
 * (@geoffe)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/htaccess-doesnt-work-when-wp-installed/#post-424355)
 * 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.
 *  Thread Starter [nieuws](https://wordpress.org/support/users/nieuws/)
 * (@nieuws)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/htaccess-doesnt-work-when-wp-installed/#post-424593)
 * 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] </IfModule>
 * # 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.
 *  Thread Starter [nieuws](https://wordpress.org/support/users/nieuws/)
 * (@nieuws)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/htaccess-doesnt-work-when-wp-installed/#post-424638)
 * Anyone?
 * 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..
 *  [geoffe](https://wordpress.org/support/users/geoffe/)
 * (@geoffe)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/htaccess-doesnt-work-when-wp-installed/#post-424642)
 * 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](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.
 *  Thread Starter [nieuws](https://wordpress.org/support/users/nieuws/)
 * (@nieuws)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/htaccess-doesnt-work-when-wp-installed/#post-424650)
 * 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.

## Tags

 * [area](https://wordpress.org/support/topic-tag/area/)
 * [folder](https://wordpress.org/support/topic-tag/folder/)
 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [outside](https://wordpress.org/support/topic-tag/outside/)
 * [password](https://wordpress.org/support/topic-tag/password/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 7 replies
 * 3 participants
 * Last reply from: [nieuws](https://wordpress.org/support/users/nieuws/)
 * Last activity: [19 years, 10 months ago](https://wordpress.org/support/topic/htaccess-doesnt-work-when-wp-installed/#post-424650)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
