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.

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

1 Answer 1


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.

  • 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 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. Sep 13, 2015 at 8:28

Your Answer

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

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