MainWP htaccess code

Home Forums BulletProof Security Pro MainWP htaccess code

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #38145
    Ljubomir Manojlovic
    Participant

    From today BPS update I have Quarantine warning of htaccess obviously created by MAinWP attempt to add code to it (remain empty like this, below BPS code.

    # BEGIN MainWP

    # END MainWP

    I have added to Custom code (section 14) code

    # 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

    Before today, no problem. What to do?

    #38146
    AITpro Admin
    Keymaster

    Yep, follow the steps in this forum topic, which I assume you have done already > https://forum.ait-pro.com/forums/topic/mainwp-wants-to-write-to-htaccess/#post-36474

    #38377
    Ljubomir Manojlovic
    Participant

    Unfortunately it keep same. It looks that MainWP changed system and actually previous code is useless. Looks that now MainWP when do any task, temporary write some code between his own   Begin/End space and when finish job remove same code. BPS react every single time and that is more than annoying. I understand that solution could be to whitelist .htaccess file, but I can’t see how it can get logic vs security plugin (should to protect that file, right?).

    So, is it any solution about it?

    P.S. – Personally, I’m quite sure how BPS should to contact MainWP to be sure what they doing and to find appropriate solution. From other side, it looks also somehow ‘ugly’ to know that BPS has such custom solution for ManageWP and for MainWP – nothing (or it is only my impression).

    #38378
    AITpro Admin
    Keymaster

    It’s perfectly fine and safe to exclude the Root htaccess file from being checked by AutoRestore. Do the steps below to exclude your Root htaccess file.

    1. Go to AutoRestore > Add|Exclude Other Folders & Files > Exclude Folders & Files.
    2. Select Exclude an Individual File option.
    3. Enter the path to your Root htaccess file.
    4. Click the Exclude button.

    #38379
    Ljubomir Manojlovic
    Participant

    Sorry, but I wrote that I know for that option. Is it some other – that was question.

    #38380
    AITpro Admin
    Keymaster

    If your Root htaccess file is locked and MainWP is unlocking your Root htaccess file and editing it then you don’t have any other options except to exclude the Root htaccess file from being checked by AutoRestore or contact MainWP and ask them to create a new option in MainWP that allows you to choose not to add the MainWP htaccess code to your Root htaccess file.

    Is your Root htaccess file locked and MainWP is unlocking it?  If not, then try locking your Root htaccess file to prevent MainWP from editing it.  If your root htaccess file was locked then you will have to do one of the 2 options that I explained above.

    #38381
    Ljubomir Manojlovic
    Participant

    Thanks. That is what I asking. So, I will try first to see what is going on with locking.

    BTW – two questions:

    1. Is it correct path for .htaccess to be /opt/bitnami/apps/mydomain/htdocs/.htaccess
    2. How to see list of those excluded files?

    And to not forget.

    1. Just to set Lock or
    2. Also to turn on Auto Lock?
    #38383
    AITpro Admin
    Keymaster

    Yes, that looks like a correct path.
    You can view excluded files by using the Remove Excluded Folders|Files Search tool on the AutoRestore > Add|Exclude Other Folders & Files tab page.  Type in a forward slash / in the Remove Excluded Folders|Files Search tool text box and click the Search button.
    Lock your root htaccess and turn On AutoLock.

    #38385
    Ljubomir Manojlovic
    Participant

    Thanks. I will post tomorrow how it works.

    #38389
    Ljubomir Manojlovic
    Participant

    I think about how it is good to finally reveal what about MainWP.

    1. After Lock steps, there were no more warnings.
    2. MainWP sent reply

    “Thank you for reaching MainWP. The only feature that MainWP needs to use custom code in .htaccss is to hide the child plugin from search engines. If this feature is required for your setup, you can copy the code from the default .htaccess file that is included in the MainWP Child plugin and insert it where it’s needed.”

    Above code is

    # BEGIN MainWP
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^(.*)$ \./THIS_PLUGIN_DOES_NOT_EXIST [QSA,L]
    </IfModule>
    # END MainWP

    FINAL QUESTION

    As I have no idea what it doing, should it be added to custom code section or not (of course, if I want that plugin will be hidden, otherwise – clearly, not)?

    #38390
    AITpro Admin
    Keymaster

    Since the MainWP htaccess code is not needed then you don’t need to add it to BPS Pro Custom Code.  Thanks for confirming that locking the Root htaccess file fixes this issue.

    #38392
    Ljubomir Manojlovic
    Participant

    Yes, confirmed again. I simply didn’t pay attention on it. Thanks for point to it. Also I think how is useful that MainWP wrote what they doing as probably is there also some other users who use it (at least in future). So, fact is how before they get some code, now only above is left (it is about 2 months old changes). Thanks again and we can close topic.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.