Setup Wizard Root htaccess File Backup

Home Forums BulletProof Security Pro Setup Wizard Root htaccess File Backup

This topic contains 8 replies, has 3 voices, and was last updated by  AITpro Admin 2 years, 4 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #26053

    AITpro Admin
    Keymaster

    The Setup Wizard checks your current root htaccess file for any existing custom or additional htaccess code that is not standard WordPress htaccess code or BPS standard htaccess code.  This is a one-time event that occurs the first time you install BPS.  If the Setup Wizard detects any existing custom or additional htaccess code in your root htaccess file, a message is displayed to you (see below) with a “Download Root htaccess File” button to download your root-htaccess-file.zip file to your computer as a backup.

    Setup Wizard Root htaccess File Backup

    1.  Click the Download Root htaccess File button and then continue with the BPS Setup Wizard setup.
    2.  For BPS Pro click the Pre-Installation Wizard button and then click the Setup Wizard button.  For BPS free click the Setup Wizard button.
    3.  After you have completed the Setup Wizard setup you can add any custom or additional htaccess code from your downloaded root htaccess file to BPS Custom Code.  See the Root htaccess File Custom Code Setup Steps below.

    Note:  If you are not sure where to add your custom or additional htaccess code from your downloaded root htaccess to BPS Custom Code then post your htaccess code in this forum topic and we will tell you where your custom or additional htaccess code goes in BPS Custom Code.

    Troubleshooting Info:
    If for some reason your website crashes after running the Setup Wizard you can restore your original root htaccess file from the Root htaccess zip file that you downloaded to your computer by doing these steps:

    1.  Unzip the root-htaccess-file.zip file on your computer.
    2.  Upload the unzipped .htaccess file to your WordPress installation folder and overwrite the BPS root htaccess file.

    Additional Help Resources & Info:
    Custom Code Video Tutorial

    BPS Pro 11.9+ & BPS .53.8+ Root htaccess File Custom Code Steps:
    1. Add your custom code in the appropriate Root Custom Code text box.
    2. Click the Save Root Custom Code button to save your Root custom code.
    3. Go to the Security Modes page and click the Root Folder BulletProof Mode Activate button.

    Older BPS versions:  Root htaccess File Custom Code Setup Steps
    1. Enter your custom code in the appropriate Root Custom Code text box.
    2. Click the Save Root Custom Code button to save your Root custom code.
    3. Go to the Security Modes page and click the Create secure.htaccess File AutoMagic button.
    4. Select the Activate Root Folder BulletProof Mode Radio button and click the Activate|Deactivate button.

    #26234

    alexb
    Participant

    I have this custom code in my htaccess (automatically added by mainwp child after plugin activation) and am not sure where in the many custom code fields I would have to put this in again. Can you help?

    # BEGIN MainWP
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^wp-content/plugins/mainwp-child/(.*)$ /wp-content/plugins/THIS_PLUGIN_DOES_NOT_EXIST [QSA,L]
    </IfModule>
    # END MainWP
    #26236

    AITpro Admin
    Keymaster

    I believe you can leave that MainWP htaccess code as is (stand-alone code) and put it in this BPS Root Custom Code text box:  CUSTOM CODE BOTTOM HOTLINKING/FORBID COMMENT SPAMMERS/BLOCK BOTS/BLOCK IP/REDIRECT CODE: or you can probably combine the MainWP code into your WordPress Rewrite Loop code and put it in this BPS Root Custom Code text box:  CUSTOM CODE WP REWRITE LOOP START:

    # WP REWRITE LOOP START
    RewriteEngine On
    RewriteBase /
    # BEGIN MainWP
    RewriteRule ^wp-content/plugins/mainwp-child/(.*)$ /wp-content/plugins/THIS_PLUGIN_DOES_NOT_EXIST [QSA,L]
    # END MainWP
    RewriteRule ^index\.php$ - [L]
    #26238

    alexb
    Participant

    Thanks! You added this at the bottom:

    RewriteRule ^index\.php$ - [L]

    Should I add that too, or use exactly what mainwp gives me? Actually, what does that mainwp code do, anyway? I have about 10 sites now where I didn’t add this code to custom and just left the htaccess file as is. will mainwp work without it?

    #26245

    AITpro Admin
    Keymaster

    Personally I think you should use the first usage:  leave that MainWP htaccess code as is (stand-alone code) and put it in this BPS Root Custom Code text box: CUSTOM CODE BOTTOM HOTLINKING/FORBID COMMENT SPAMMERS/BLOCK BOTS/BLOCK IP/REDIRECT CODE: and not try to combine the MainWP code into your standard BPS WP Rewrite Loop code just to keep things as simple as possible.

    The standard BPS WordPress Rewrite Loop htaccess code is this below.  So you would be combining the MainWP code into the standard BPS WP Rewrite Loop code.  In general, the MainWP RewriteRule says to rewrite all files in this folder: /mainwp-child/ to this example folder that you used in your example code:  THIS_PLUGIN_DOES_NOT_EXIST and append any Query Strings:  QSA.  For specific information about what the MainWP code does you would have to ask MainWP about that.

    # WP REWRITE LOOP START
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    #26251

    alexb
    Participant

    Thanks, I’ll use the standard code then. I also have 2 other custom codes in there (those suggested from the top of the bps dashboard – 2 different ones (post request attack and xmlrpc-ddos protection). Should I put the mainwp one right below those or does the order of these codes within that one box not matter?

    #26253

    AITpro Admin
    Keymaster

    There is no correct order for any code in the BPS Root Custom Code text box: CUSTOM CODE BOTTOM HOTLINKING/FORBID COMMENT SPAMMERS/BLOCK BOTS/BLOCK IP/REDIRECT CODE:  All of the htaccess code that goes in this Custom Code text box is stand-alone code.

    #28235

    paulnevin
    Participant

    All wordpress sites using permalinks will have created custom entries in the  data.

     

    #28238

    AITpro Admin
    Keymaster

    @ paulnevin – Yes, that is correct if you are using Pretty or Custom Permalinks and not standard/default Permalinks.  BPS incorporates Custom WP Permalinks in the standard BPS htaccess Root htaccess code.  So you do not need to add that standard WP code twice/again or you will run into Rewrite Looping problems.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.