htaccess & plugin conflict
-
Hello,
The following prevents a plugin to automatically generate a pdf of a signed contract. This plugin normally worked before with iThemes plugin.
There are (2 parts) that are preventing the plugin to work:
1. There’s a section where one can sign with a mouse, stylus or finger on a mobile. This doesn’t work with iThemes plugin.
2. Once the document is signed, there’s a button to generate the signed document. This also doens’t work with iThemes plugin.
*********************************************
I’ve found where each of the two parts are conflicting.
1. There’s a file named signaturesave.php inside the plugin for contracts that apparently as the name suggests, saves the signature.
>> I found that iThemes plugin blocks requests to PHP files inside plugin directories:# Disable PHP in Plugins - Security > Settings > System Tweaks > PHP in Plugins RewriteRule ^wp\-content/plugins/.*\.(?:php[1-7]?|pht|phtml?|phps)$ - [NC,F]
I added the following to request that file (is this “safe” or correct?):
# Disable PHP in Plugins - Security > Settings > System Tweaks > PHP in Plugins RewriteCond %{REQUEST_FILENAME} !(signaturesave\.php) RewriteRule ^wp\-content/plugins/.*\.(?:php[1-7]?|pht|phtml?|phps)$ - [NC,F]
*********************************************
2. With the above, the signed document can now be saved. With that, it was not generating the PDF version for download. I found that the following was preventing that:
RewriteCond %{HTTP_USER_AGENT} "^$" [NC,OR]
Is there a way to still keep the above line, or edit while still having the security benefits? I tried the following and it works, though I’m not sure if that’s a safe way to do this.
To “whitelist” it:
RewriteCond %{HTTP_USER_AGENT} "^$" [NC,OR] # white list the above line? RewriteRule "^ -" [L]
*********************************************
I’m not too familiar with this type of code, but I’m very comfortable to edit, so I would truly appreciate any input on your part. I’m hoping you can instruct me if that’s an acceptable way to do this. At this point, all I’ve done is try to see what has “worked” but reverted until further instructions or guidance.
Would you kindly let me know if these are acceptable; and if not, would you please guide me in keeping the safety while allowing for the plugin to work as it did before with iThemes?
Thank you in advance, I appreciate your time and effort.
Best regards.
- The topic ‘htaccess & plugin conflict’ is closed to new replies.