Home › Forums › BulletProof Security Pro › MainWP htaccess code
- This topic has 12 replies, 3 voices, and was last updated 3 years, 11 months ago by Runkle.
-
AuthorPosts
-
Ljubomir ManojlovicParticipant
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?
AITpro AdminKeymasterYep, 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
Ljubomir ManojlovicParticipantUnfortunately 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).
AITpro AdminKeymasterIt’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.Ljubomir ManojlovicParticipantSorry, but I wrote that I know for that option. Is it some other – that was question.
AITpro AdminKeymasterIf 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.
Ljubomir ManojlovicParticipantThanks. That is what I asking. So, I will try first to see what is going on with locking.
BTW – two questions:
- Is it correct path for .htaccess to be /opt/bitnami/apps/mydomain/htdocs/.htaccess
- How to see list of those excluded files?
And to not forget.
- Just to set Lock or
- Also to turn on Auto Lock?
AITpro AdminKeymasterYes, 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.Ljubomir ManojlovicParticipantThanks. I will post tomorrow how it works.
Ljubomir ManojlovicParticipantI think about how it is good to finally reveal what about MainWP.
- After Lock steps, there were no more warnings.
- 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)?
AITpro AdminKeymasterSince 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.
Ljubomir ManojlovicParticipantYes, 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.
RunkleParticipantWe’re pleased to announce our partnership with MainWP and becoming the first web host to automatically setup and install the MainWP Dashboard with WordPress! Our team has been working very closely with Dennis to ensure our WordPress environment is optimized for the MainWP Dashboard plugin.
-
AuthorPosts
- You must be logged in to reply to this topic.