Bad Request POST param “redirect” was invalid I'm creating a user profile form on the front-end of our website. I've removed all template code and replaced it with the documentation code from the Craft website. I updated the docs code to reflect fields that we're using, rather than the example fields.

Upon clicking the Save Profile button, the next thing I get is this error:

**Bad Request**

POST param “redirect” was invalid.


I've changed the redirect action input to multiple values, but none work.

I'm running Craft 2.6.3008.

Update: Here's the form:

&lt;form method="post" accept-charset="UTF-8"&gt;
    {{ getCsrfInput() }}
    &lt;input type="hidden" name="action" value="users/saveUser"&gt;
    &lt;input type="hidden" name="redirect" value="account/profile?m=updated"&gt;
    &lt;input type="hidden" name="userId" value="{{ currentUser.id }}"&gt;

    &lt;label for="firstName"&gt;First Name&lt;/label&gt;
    &lt;input type="text" id="firstName" name="firstName" value="{{ currentUser.firstName }}"&gt;

    &lt;label for="lastName"&gt;Last Name&lt;/label&gt;
    &lt;input type="text" id="lastName" name="lastName" value="{{ currentUser.lastName }}"&gt;

    &lt;input type="submit" value="Save Profile"&gt;
&lt;/form&gt;


The form is located at account/profile. I'm asking it to return to the same template, just with a parameter appended to the address to verify the form was updated.
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 %}