Bad Request POST param “redirect” was invalid
UPDATE and final answer: The culprit was having the general config setting validateUnsafeRequestParams =&gt; true and not having my redirect value hashed ({{ 'account/profile' | hash }}). I had completely forgotten I had that setting turned on. Mijingo has a good explainer of how this setting works: https://mijingo.com/blog/hashing-redirect-params-in-craft

I'll still use the flash notice below for this particular case, but now I know what this error message comes from.



My goal was that I was trying to redirect the form back to the same template, only with an appended parameter on the URL so I could write an update notice.

I never found out why I got the error, but ultimately it didn't matter as I found a better way of creating that notice through this answer here. Just by adding this to my template.

{% if craft.session.getFlash('notice') == 'User saved.'|t %}
  &lt;p&gt;Success message!&lt;/p&gt;
{% endif %}