Title: Subfolder problem
Last modified: August 30, 2016

---

# Subfolder problem

 *  Resolved [SEO Hungary](https://wordpress.org/support/users/pontkom/)
 * (@pontkom)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/subfolder-problem/)
 * HI
 * Great WP plugin! I run into the following problem, i have another script installed
   under /home/something if i turn on NF i cant create session for that script i
   have to login 10 times to make any change….always log me out. If i run off NF
   everything comes back to normal.
 * Im on shared cpanel hosting i have few addon domain under /home i see the same
   problem under those dir.
 * Thanx
    Sam
 * [https://wordpress.org/plugins/ninjafirewall/](https://wordpress.org/plugins/ninjafirewall/)

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

 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/subfolder-problem/#post-6786150)
 * Hi,
 * If you want to disable the firewall for one or more subfolders, you can use the
   [.htninja configuration file](http://nintechnet.com/ninjafirewall/wp-edition/help/?htninja).
   
   For instance, to whitelist the /foo/bar/ directory:
 *     ```
       <?php
       /*
        +===================================================================+
        | NinjaFirewall optional configuration file                         |
        |                                                                   |
        | See: http://nintechnet.com/ninjafirewall/wp-edition/help/?htninja |
        +===================================================================+
       */
   
       if (strpos($_SERVER['SCRIPT_NAME'], '/foo/bar/') !== FALSE) {
          return 'ALLOW';
       }
       ```
   
 *  Thread Starter [SEO Hungary](https://wordpress.org/support/users/pontkom/)
 * (@pontkom)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/subfolder-problem/#post-6786160)
 * HI
 * I did but didnt help, i created new file named it .htninja i copied what you 
   sent i changed the folder name etc….still making the same problem.
    NF see the
   Optional configuration file but not working, i want to disable for example: home/
   user/public_html/subfolder
 * so i changed the code
 * if (strpos($_SERVER[‘SCRIPT_NAME’], ‘/subfolder/’) !== FALSE) {
    return ‘ALLOW’;}
 * Not working….Pls help me.
 * Thanx
 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/subfolder-problem/#post-6786165)
 * Maybe you can try $_SERVER[‘SCRIPT_FILENAME’] instead of $_SERVER[‘SCRIPT_NAME’]?
 *  Thread Starter [SEO Hungary](https://wordpress.org/support/users/pontkom/)
 * (@pontkom)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/subfolder-problem/#post-6786172)
 * HI
 * Great working! What if i need to add more directory? Thanx a lot
    Sam
 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/subfolder-problem/#post-6786193)
 * You can add as many as you want:
 *     ```
       if ( strpos($_SERVER['SCRIPT_FILENAME'], '/somefolder/')    !== FALSE ||
            strpos($_SERVER['SCRIPT_FILENAME'], '/subfolder/')     !== FALSE ||
            strpos($_SERVER['SCRIPT_FILENAME'], '/anotherfolder/') !== FALSE ) {
          return 'ALLOW';
       }
       ```
   
 *  Thread Starter [SEO Hungary](https://wordpress.org/support/users/pontkom/)
 * (@pontkom)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/subfolder-problem/#post-6786196)
 * Thanx a lot! Great plugin, great support:)

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

The topic ‘Subfolder problem’ is closed to new replies.

 * ![](https://ps.w.org/ninjafirewall/assets/icon-256x256.png?rev=976137)
 * [NinjaFirewall (WP Edition) - Advanced Security Plugin and Firewall](https://wordpress.org/plugins/ninjafirewall/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ninjafirewall/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ninjafirewall/)
 * [Active Topics](https://wordpress.org/support/plugin/ninjafirewall/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ninjafirewall/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ninjafirewall/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [SEO Hungary](https://wordpress.org/support/users/pontkom/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/subfolder-problem/#post-6786196)
 * Status: resolved