<p>From <code>'p' =&gt; '500.shtml'</code> it looks like your server is configured to redirect to a <code>500.shtml</code> file whenever it encounters an error, which is probably confusing Craft routing and obscuring the real error message.</p>

<p>I'd check to see if you have Suhosin or ModSecurity installed on the server as it's possible the link you're trying to add it tripping up one of their rules.</p>

CC BY-SA 4.0
2019-12-09T12:53:27.100Z
ModSecurity is installed. I tried to recreate the entry with the same content and add the link and ModSecurity interpreted that attempt as a SQL injection and temporarily blacklisted my IP.

What Isn't clear to me is why adding a link here would be tripping it up. The content of the link does not seem to matter and even attempting to add an anchor to the redactor with a blank href is causing this issue, but only on this entry.
Josh Parylak
CC BY-SA 4.0
2019-12-09T16:43:38.063Z
¯\_(ツ)_/¯ - I've only had headaches with ModSecurity.
Brad Bell
CC BY-SA 4.0
2019-12-09T20:07:52.057Z
This was exactly it, they were able to whitelist the rule for the admin to get us running again. Thanks Brad.
Josh Parylak
CC BY-SA 4.0
2019-12-10T19:06:52.903Z
Glad to hear!!!
Brad Bell
CC BY-SA 4.0
2019-12-06T21:06:59.493Z
2019-12-06T21:06:59.493Z
Brad Bell
<p>I'm having a strange issue here. I have a site running Craft 3.3.7. I have an entry with a matrix field with several redactor fields in it. In one of those redactor fields, I have a paragraph of text. I can save the entry fine, until I try to add a hyperlink (either via the button or adding it in the html editor) at which point I get a Bad Request: Post Request Required error.</p>

<p>I can add hyper links to the other redactor blocks on the entry and to other entries on the site. I tried simply adding a new block and moving the text to there but I get the same error.</p>

<p>I can save the paragraph without the link, so there doesn't seem to be a strange character throwing it off. And it has nothing to do with the href destination as I tried several and even left it empty and received the error every time.</p>

<p>I found an issue in the Redactor github that looks similar that was related to the HTML Purifier, but that it is switched off for this field.</p>

<p>I've checked with server support and there are no relevant errors displaying on that end.</p>

<p>I've checked the craft error logs and it looks like adding the hyper link is causing the attempt to save to come through as an empty post request, thus the error. Unsure why that is.</p>

<pre><code>2019-12-06 17:38:24 [-][12172][ql7adqo20ana0h4he9iiv3iv30][error][yii\web\HttpException:400] yii\web\BadRequestHttpException: Post request required in /home/[sitename]/vendor/craftcms/cms/src/web/Controller.php:333
Stack trace:
#0 /home/[sitename]/vendor/craftcms/cms/src/controllers/EntriesController.php(311): craft\web\Controller-&gt;requirePostRequest()
#1 [internal function]: craft\controllers\EntriesController-&gt;actionSaveEntry(false)
#2 /home/[sitename]/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /home/[sitename]/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction-&gt;runWithParams(Array)
#4 /home/[sitename]/vendor/craftcms/cms/src/web/Controller.php(187): yii\base\Controller-&gt;runAction('save-entry', Array)
#5 /home/[sitename]/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller-&gt;runAction('save-entry', Array)
#6 /home/[sitename]/vendor/craftcms/cms/src/web/Application.php(299): yii\base\Module-&gt;runAction('entries/save-en...', Array)
#7 /home/[sitename]/vendor/craftcms/cms/src/web/Application.php(566): craft\web\Application-&gt;runAction('entries/save-en...', Array)
#8 /home/[sitename]/vendor/craftcms/cms/src/web/Application.php(278): craft\web\Application-&gt;_processActionRequest(Object(craft\web\Request))
#9 /home/[sitename]/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application-&gt;handleRequest(Object(craft\web\Request))
#10 /home/[sitename]/html/index.php(21): yii\base\Application-&gt;run()
#11 {main}
2019-12-06 17:38:24 [-][12172][ql7adqo20ana0h4he9iiv3iv30][info][application] $_GET = [
    'p' =&gt; '500.shtml'
]

$_POST = []

$_FILES = []
</code></pre>

<redactor><error-message><saveentry><post>
Bad Request: Post Request Required when saving hyperlink in specific redactor field
# Bad Request: Post Request Required when saving hyperlink in specific redactor field

(Asked by: username_0 on 2019-12-06)

I'm having a strange issue here. I have a site running Craft 3.3.7. I have an entry with a matrix field with several redactor fields in it. In one of those redactor fields, I have a paragraph of text. I can save the entry fine, until I try to add a hyperlink (either via the button or adding it in the html editor) at which point I get a Bad Request: Post Request Required error.
I can add hyper links to the other redactor blocks on the entry and to other entries on the site. I tried simply adding a new block and moving the text to there but I get the same error.
I can save the paragraph without the link, so there doesn't seem to be a strange character throwing it off. And it has nothing to do with the href destination as I tried several and even left it empty and received the error every time.
I found an issue in the Redactor github that looks similar that was related to the HTML Purifier, but that it is switched off for this field.
I've checked with server support and there are no relevant errors displaying on that end.
I've checked the craft error logs and it looks like adding the hyper link is causing the attempt to save to come through as an empty post request, thus the error. Unsure why that is.
2019-12-06 17:38:24 [-][12172][ql7adqo20ana0h4he9iiv3iv30][error][yii\web\HttpException:400] yii\web\BadRequestHttpException: Post request required in /home/[sitename]/vendor/craftcms/cms/src/web/Controller.php:333
Stack trace:
#0 /home/[sitename]/vendor/craftcms/cms/src/controllers/EntriesController.php(311): craft\web\Controller->requirePostRequest()
#1 [internal function]: craft\controllers\EntriesController->actionSaveEntry(false)
#2 /home/[sitename]/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /home/[sitename]/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#4 /home/[sitename]/vendor/craftcms/cms/src/web/Controller.php(187): yii\base\Controller->runAction('save-entry', Array)
#5 /home/[sitename]/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save-entry', Array)
#6 /home/[sitename]/vendor/craftcms/cms/src/web/Application.php(299): yii\base\Module->runAction('entries/save-en...', Array)
#7 /home/[sitename]/vendor/craftcms/cms/src/web/Application.php(566): craft\web\Application->runAction('entries/save-en...', Array)
#8 /home/[sitename]/vendor/craftcms/cms/src/web/Application.php(278): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#9 /home/[sitename]/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#10 /home/[sitename]/html/index.php(21): yii\base\Application->run()
#11 {main}
2019-12-06 17:38:24 [-][12172][ql7adqo20ana0h4he9iiv3iv30][info][application] $_GET = [
    'p' => '500.shtml'
]

$_POST = []

$_FILES = []

**Tags:** redactor, error-message, saveentry, post


---

## 1 answers

### Answer by username_1 on 2019-12-06. Score: 0 | Accepted answer

From `'p' => '500.shtml'` it looks like your server is configured to redirect to a `500.shtml` file whenever it encounters an error, which is probably confusing Craft routing and obscuring the real error message.

I'd check to see if you have Suhosin or ModSecurity installed on the server as it's possible the link you're trying to add it tripping up one of their rules.

> **Comments:**
> **username_0**: ModSecurity is installed. I tried to recreate the entry with the same content and add the link and ModSecurity interpreted that attempt as a SQL injection and temporarily blacklisted my IP.  What Isn't clear to me is why adding a link here would be tripping it up. The content of the link does not seem to matter and even attempting to add an anchor to the redactor with a blank href is causing this issue, but only on this entry.  
> **username_1**: ¯\_(ツ)_/¯ - I've only had headaches with ModSecurity.  
> **username_0**: This was exactly it, they were able to whitelist the rule for the admin to get us running again. Thanks Brad.  
> **username_1**: Glad to hear!!!  

---

