Redirect after login

Dear Colleague,
i have crated a webpage that i shared with some institutes:
To access the webpage a login is required. as such, after the login the users are redirected to the home page instead of the link i shared with them.
is there a way to solve this issue. By the way this issue is not specific of the page i mentioned and happens with other pages.
I was looking into previous postings and this seems to be a redirect issue that can be handled by installing the redirect module. however none of the previous postings was clear in terms of configuration.
thanks for you help.

Hey @joao,

Since the website has it’s content (published) restricted to anonymous user the webpage you mentioned asks them to login. By default Drupal website redirects the users to the Landing page (/admin/config/system/site-information) of the website upon successful login. To avoid this you can follow up with either of the two alternatives listed below :

  • You can browse to /admin/people/permissions and check the View published content checkbox for anonymous users. (This will make all the content on your website public for users)


  • Use a specific drupal contributed module (Ex: Permissions by Term Module) which allows access to users on node level basis thus making this specific node visible to anonymous users without asking for a login.

I hope this helps. In case you require any further help with this or any such issue feel free to write us back here.


Hi Prakhar,
thanks for your reply. in fact i don’t want to change the access rights i.e. i don’t want to make any content public. I just want that after the login, the user is automatically redirected to the link i shared with them and not the homepage. this was possible in previous versions of drupal.
anyway if this difficult to solve I’ll instruct users to keep themselves logged in the website so that they are not required to log in when i share a link with them.

Hey @joao,

Unfortunately it is by default for all websites that upon login the users are redirected to the Home/Landing page.

If the team finds any alternative to it we will redirect the same to you as well. Until then you can proceed with the solution you mentioned or you can make the specific webpage accessible to all users irrespective of the login (something what I suggested in my previous reply)

Have a nice weekend ahead !


I agree with Joao that this is not the desired behavior. When accessing a protected link the user should land on the requested page after login and not on the home page or anything else. This was working before the migration to Openshift and D9 and we are all waiting for a proper solution since. It would really be nice if again their could be a php snippet (or whatever it needs to sort this out) provided.

Hey guys,

We understand the gravity of the issue and how useful it would be to have gained things back to what we had in the previous versions of drupal.

This is a well known issue to the team and we have flagged it in our future sprints as well. We are looking into it to deliver upon a desired sustainable solution for the same.

Thanks and regards,

1 Like

Hi @joachim @pkatyaya and team,

Is there any solution to this issue? It’s really causing a major usability issue.

In my case, I have quite a lot of restricted Views set deeper in the IT Dept website, and forcing users to have to navigate back to where they originally were (which may not be obvious, especially if they were given a direct link to a given page/view) is causing quite a lot of frustration.

Redirect 403 to Login module, which includes the option to redirect user back to where they were trying to originally access, just is not working. The behaviour is the same no matter what I try.

Any news gratefully received!