Title: Correct file for codes
Last modified: December 14, 2021

---

# Correct file for codes

 *  Resolved [Jaso](https://wordpress.org/support/users/subwebsites/)
 * (@subwebsites)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/correct-file-for-codes/)
 * Hi,
 * This says NOT to use .htninja , BUT doesnt say which file to add the code.
 * [https://prnt.sc/22wy4dl](https://prnt.sc/22wy4dl)
 * Which file am I to add this code so my physical server is whitelisted???
 * Thanks

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

 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/correct-file-for-codes/#post-15163139)
 * If you want to whitelist your server, follow the instructions in the screenshot
   and simply replace `1.2.3.4` with your server’s IP in the “.htninja” file.
    Live
   Log will work as usual. It wouldn’t work if you whitelisted your personal IP 
   address, not the server’s.
 *  Thread Starter [Jaso](https://wordpress.org/support/users/subwebsites/)
 * (@subwebsites)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/correct-file-for-codes/#post-15163839)
 * Hi,
    My site has created 3 different ntninja files, which one? Thanks
 *  Thread Starter [Jaso](https://wordpress.org/support/users/subwebsites/)
 * (@subwebsites)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/correct-file-for-codes/#post-15163855)
 * ..
    -  This reply was modified 4 years, 5 months ago by [Jaso](https://wordpress.org/support/users/subwebsites/).
 *  Thread Starter [Jaso](https://wordpress.org/support/users/subwebsites/)
 * (@subwebsites)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/correct-file-for-codes/#post-15163926)
 * Ahh, ok, am I to create file in this location called .htninja
    [https://prnt.sc/230gzh7](https://prnt.sc/230gzh7)
   correct ?
 * No docs anywhere mention we need to create this in this location
 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/correct-file-for-codes/#post-15167052)
 * The doc is here: [https://blog.nintechnet.com/ninjafirewall-wp-edition-the-htninja-configuration-file/](https://blog.nintechnet.com/ninjafirewall-wp-edition-the-htninja-configuration-file/)
 * > This file must be named .htninja and must be located either:
   >  * In the folder
   > above your website document root: If your document root is /home/user/public_html/,
   > the location of the file will be /home/user/.htninja. This is the recommended
   > choice. Because it is located outside the document root, the file is relatively
   > safe and protected. However, if you have an open_basedir restriction, PHP will
   > not be able to access it. * In the document root folder: If your document root
   > is /home/user/public_html/, the location of the file will be /home/user/public_html/.
   > htninja. Recommended only if you have an open_basedir restriction. If you are
   > using the Apache HTTP server, the file is relatively protected because, by 
   > default, it will never serve a file whose name starts with .ht*. However, if
   > you are using Nginx or any other HTTP server that doesn’t use .htaccess files,
   > you must set it up so that it will block any access to the file from a web 
   > browser.`
 *  Thread Starter [Jaso](https://wordpress.org/support/users/subwebsites/)
 * (@subwebsites)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/correct-file-for-codes/#post-15167892)
 * Hi, pls see image snap here:
    [https://prnt.sc/2364jdy](https://prnt.sc/2364jdy)
 * Thanks
 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/correct-file-for-codes/#post-15169634)
 * Upload it into the public_html folder.

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

The topic ‘Correct file for codes’ 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/)

 * 7 replies
 * 2 participants
 * Last reply from: [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/correct-file-for-codes/#post-15169634)
 * Status: resolved