1

I'm running Magento latest version on Nexcess server.

I have created custom module to store template design in database. I'm using PHP code within textarea like,

<div> First Name: <?php echo $order->getFirstname?></div>

I'm using form Post method. When trying to save data It's throwing 403 Forbidden error. However when i'm adding same content to the CMS Block, CMS Page and transactional emails, it's working fine.

Note: I have changed all file permission to 644 and folder permission to 755 except var (777) and media (777).

Apache mod_security extension is enabled on server. But why different behaviour between CMS page and my custom module.

3
  • Do you have a custom WYSIWYG Editor field in your module ? behalf of Akhilesh Patel
    – Amit Bera
    Commented Sep 11, 2015 at 11:10
  • I tried with WYSIWYG Editor and Simple textarea. both showing 403 Forbidden Error Commented Sep 11, 2015 at 11:18
  • 1
    Have you checked the logs?
    – mbalparda
    Commented Sep 11, 2015 at 11:54

1 Answer 1

2

You may have triggered some Mod Security rules with your custom module.

Try checking your Mod Security logs or disable it and see if it works.

If it's confirmed to be caused by Mod Security, you can either identify the particular rule and disable it or change your codes to workaround the rule.

2
  • I have added my ip to the white list. And it's working fine. But not able to understand why with CMS it was working fine and not works with other custom module Commented Sep 12, 2015 at 18:23
  • You will most likely face the same issues where non-whitelisted IPs (like your visitors or other users) may be blocked by Mod Security. Your custom module's codes must have triggered some Mod Security rules while Magento's code doesn't. Commented Sep 13, 2015 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.