'403 Forbidden Error Posting PHP/HTML Form
I have recently run into an issue where for some reason posting a html form immediately results in a "403 forbidden" error as soon as I click the submit button in my website. The web page loads perfectly fine before the submit button is clicked. My website is written in PHP and is running on an Amazon ec2 instance. Everything was working perfectly fine until all of a sudden I started getting this error. I had done extensive prior testing of this code and for some reason this only started happening now.
I have tried making a .htaccess file with the lines:
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
but this doesn't seem to do anything (I did set EnableOveride All for my /var/www directory where my php files live).
I'm just not too sure where to go with this as the code was working perfectly fine with exactly the same form but now all of a sudden it no longer works. I even tried commenting out my php and just submitting the form with no logic to follow and still see this error so I don't think its a code issue but rather an apache/php issue on the server.
(I can't really post too much of my code cause its for an assignment)
Solution 1:[1]
I found the solution to this. I had an Amazon web application firewall that was blocking the posting of html forms. Disabling this allowed for the form to be posted as normal.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Aiden Contini |
