Title: Where do I put custom code
Last modified: August 22, 2016

---

# Where do I put custom code

 *  Resolved [ZewaLogi](https://wordpress.org/support/users/amazinghulk/)
 * (@amazinghulk)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/where-do-i-put-custom-code/)
 * Hello
 * First I got to say this is a great plugin.
 * My questions is if some plugin asks to add additional code to htacess where do
   I put it?
 * secure .htaccess, default .htaccess, wp-admin secure, current root , current 
   wp-admin. Where?
 * [https://wordpress.org/plugins/bulletproof-security/](https://wordpress.org/plugins/bulletproof-security/)

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

 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/where-do-i-put-custom-code/#post-5429818)
 * You would use BPS Custom Code to add and save that plugin’s htaccess code permanently.
   Each Custom Code text box has a description of what type of htaccess code goes
   in that particular Custom Code text box. This Custom Code video tutorial: [http://forum.ait-pro.com/video-tutorials/#custom-code](http://forum.ait-pro.com/video-tutorials/#custom-code)
   may be helpful to you to determine where the additional htaccess code goes. If
   you still have questions after watching the video tutorial then post what type
   of htaccess code it is. ie cache htaccess code, php handler htaccess code, redirect
   htaccess code, etc.
 *  Thread Starter [ZewaLogi](https://wordpress.org/support/users/amazinghulk/)
 * (@amazinghulk)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/where-do-i-put-custom-code/#post-5429840)
 * Thanks for quick response.
 * I want to add WP Rocket settings into .htaccess. It is cache plugin and when 
   I activate it I get :
 * _WP Rocket: If you had writing permissions on .htaccess file, WP Rocket could
   do this automatically. This is not the case, so here are the rewrite rules you
   have to put in your .htaccess file for WP Rocket to work correctly._
 * So I copy code and put in Custom Code root htaccess file / CUSTOM CODE TOP PHP/
   PHP.INI HANDLER/CACHE CODE:
    Add php.ini handler and/or plugin cache code here
 * like suggested in video.
 * But I still get above message after save so I pressume I didnt do something good.
 * Cant I just paste code in current root htaccess file?
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/where-do-i-put-custom-code/#post-5429842)
 * WP Rocket is probably doing an “Always On” check to see if the root htaccess 
   file is writable/not locked. In other words, WP Rocket will always see that the
   root htaccess file is not writable. It might be that WP Rocket is doing a couple
   of checks something like this: if WP Rocket htaccess code actually exists in 
   the root htaccess file then don’t bother to check if the root htaccess file is
   writable… or maybe not.
 * In any case, have you done all of the BPS Root Custom Code steps?
    1. Copy and
   paste your htaccess code to the appropriate Root Custom Code text box. 2. Click
   the Save Root Custom Code button. 3. Go to the Security Modes page, click the
   Create secure.htaccess File AutoMagic button and activate Root folder BulletProof
   Mode.
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/where-do-i-put-custom-code/#post-5429848)
 * > Cant I just paste code in current root htaccess file?
 * Yes you could do that, but the benefit of using Custom Code is that it is saved
   permanently. AutoMagic will use any code you have saved to Custom Code instead
   of the standard BPS htaccess code. Example: If you added your htaccess code directly
   into the root htaccess file and click the AutoMagic buttons at a later time then
   your code would be replaced with BPS standard htaccess code. If you use Custom
   Code your custom code is added to the root htaccess file anytime/everytime you
   click the AutoMagic buttons.
 *  Thread Starter [ZewaLogi](https://wordpress.org/support/users/amazinghulk/)
 * (@amazinghulk)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/where-do-i-put-custom-code/#post-5429871)
 * Thanks. I havent done steps 3.
 * Now message is gone and I can see custom code in .htaccess.
 * One more question.
 * I have Hide My WP plugin and to configure it I get:
 * _You use BulletProof security plugin. To make it work correctly you need to configure
   Hide My WP manually._
 * Add these lines right before: RewriteCond REQUEST_FILENAME} !-f.
 * Where in custom code should I put those extra lines
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/where-do-i-put-custom-code/#post-5429873)
 * 1. Copy and paste the entire WP REWRITE LOOP START section of code from your 
   root .htaccess file into the WP REWRITE LOOP START Custom Code text box text 
   box.
    2. Add the Hide My WP htaccess code after the WP Rewrite Loop Start htaccess
   code. 3. Click the Save Root Custom Code button. 4. Go to the Security Modes 
   page, click the Create secure.htaccess File AutoMagic button and activate Root
   folder BulletProof Mode.
 *  Thread Starter [ZewaLogi](https://wordpress.org/support/users/amazinghulk/)
 * (@amazinghulk)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/where-do-i-put-custom-code/#post-5429894)
 * Thanks

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

The topic ‘Where do I put custom code’ is closed to new replies.

 * ![](https://ps.w.org/bulletproof-security/assets/icon-128x128.png?rev=1731938)
 * [BulletProof Security](https://wordpress.org/plugins/bulletproof-security/)
 * [Support Threads](https://wordpress.org/support/plugin/bulletproof-security/)
 * [Active Topics](https://wordpress.org/support/plugin/bulletproof-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bulletproof-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bulletproof-security/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [ZewaLogi](https://wordpress.org/support/users/amazinghulk/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/where-do-i-put-custom-code/#post-5429894)
 * Status: resolved