When you're running Wordpress, and/or a forum with it, you may run into modsecurity being a little too eager in catching potential issues.
I've ran into this in the past (see this article on modsecurity fixes). Trying to help a friend, running his website on a server that uses InterWorx (instead of cPanel/WHM), gave me a few challenges that I had not expected.
Anyhoo - since I couldn't find a quick fix, I figured I'd post it here, just in case I need it in the future or some else is looking for this.
First you will need to know what modsecurity rules are causing problems. You can find these in you Apache log.
For this example I'll just assume that rules 300015 and 300016 are a problem.
Note:
Before applying the exception, make sure to reproduce the issue as simple as possible, so we can test if the exception worked when applied.
Next we need to know the URL that is causing this problem.
Let's say the URL is https://www.example.com/forum/garden/flowers where folks can post in the "garden" forum's sub topic "flowers".
Key here is: /forum/garden/flowers
However, if you'd like to apply this for the entire forum, you could use: /forum
Next we need to edit (or create) a whitelist.conf file:
/etc/httpd/modsecurity.d/whitelist.conf
I used nano for that, so:
cd /etc/httpd/modsecurity.d
nano whitelist.conf
Now we need to add our exception like so:
<IfModule mod_security2.c>
<LocationMatch "/forum">
SecRuleRemoveById 300015 300016
</LocationMatch>
</IfModule>
Now save the file (CTRL+X), and use httpd to test the syntax for typos:
httpd -t
and restart Apache to put in play
systemctl restart httpd
Good time to test if this worked.