1

I am currently trying to make it so when I have logged in on my website as a user it redirects to a certain page.

However it is not working.

I have tried adding the following redirect in the configuration file however no luck:

'postLoginRedirect' => 'profile/test'

Any tips or suggestions will be appreciated.

  • 2
    Do you want the redirect to happen after the user logs in via a front-end form, or via the /admin/login form? If it's the latter, you need to use postCpLoginRedirect. – Stephen Lewis Mar 25 '17 at 14:56
1

You can always set a path in the actual form as well.

<input type="hidden" name="redirect" value="/some/url">

Just drop this field in the login form, assuming this is what you're using.

https://craftcms.com/docs/templating/login-form

| improve this answer | |
2

Thanks guys. I solved it. The issue was that I was logging in as the admin not an ordinary user.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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