Title: Exclude folder &#8211; htaccess
Last modified: November 9, 2017

---

# Exclude folder – htaccess

 *  Resolved Anonymous User 14379775
 * (@anonymized-14379775)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/exclude-folder-htaccess/)
 * Hi!
 * I need to exclude 1 folder (and all subfolders and files inside) in the root,
   say “folder” so it works without WP.
    I have subdirectories based Network with
   standard .htaccess:
 *     ```
       RewriteEngine On
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
   
       # add a trailing slash to /wp-admin
       RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
   
       RewriteCond %{REQUEST_FILENAME} -f [OR]
       RewriteCond %{REQUEST_FILENAME} -d
       RewriteRule ^ - [L]
       RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
       RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
       RewriteRule . index.php [L]
       ```
   
 * What’s missing here? Because subfolders are still shown by WP…
 *     ```
       RewriteEngine On
       RewriteBase /
       RewriteRule ^/folder($|/) - [L] 
       RewriteRule ^index\.php$ - [L]
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Jacob Smith](https://wordpress.org/support/users/smithjw1/)
 * (@smithjw1)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/exclude-folder-htaccess/#post-9672282)
 * You can add a single rule:
 * > RewriteRule ^(folder)($|/) – [L]
 * Place that after the RewriteBase / line
 * That says if you match that rule stop executing more rules. You can see other
   rules like it at the bottom of the list set to bypass wp-content, etc.
 * You can read [this page](https://stackoverflow.com/questions/1848500/htaccess-mod-rewrite-how-to-exclude-directory-from-rewrite-rule)
   for more info.
 *  Thread Starter Anonymous User 14379775
 * (@anonymized-14379775)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/exclude-folder-htaccess/#post-9672430)
 * It works! Thanks [@smithjw1](https://wordpress.org/support/users/smithjw1/)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Exclude folder – htaccess’ is closed to new replies.

## Tags

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

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 2 replies
 * 2 participants
 * Last reply from: Anonymous User 14379775
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/exclude-folder-htaccess/#post-9672430)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
