My login form is not redirect like I want it to.

<form method="post" accept-charset="UTF-8">
{{ csrfInput() }}
<input type="hidden" name="action" value="users/login">
<input type="hidden" name="redirect" value="profile">

<h3><label for="loginName">Username or email</label></h3>
<input id="loginName" type="text" name="loginName"
    value="{{ craft.app.user.rememberedUsername }}">

<h3><label for="password">Password</label></h3>
<input id="password" type="password" name="password">
    <input type="checkbox" name="rememberMe" value="1">
    Remember me

<input type="submit" value="Login">

Anybody know why?

1 Answer 1


All redirect parameters needs to be hashed in Craft 3. If not, they're completely ignored.

Try using:

<input type="hidden" name="redirect" value="{{ '/profile' | hash }}">


{{ redirectInput('profile') }}
  • That would explain why every redirect variation I attempted failed. This works perfectly, thank you. Aug 24, 2018 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.