Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
under "adminster" -> "Site-information" i defined my "Front Page" - my front-page call "node/home".
Now - when a user login from the "real" front-page (www.domain.com/) - the redirect after login is to www.domain.com/node/home .... this i dont need - the user must redirect to www.domain.com/ and not to www.domain.com/node/home
Can anyone help me what php-code i must use for "Login Destination" to make the redirect to the "real" front-page after login?
Sorry for my bad english - i hope you understand my problem.
Regards
Matthias
Comments
Comment #1
4ud CreditAttribution: 4ud commented@Matthias,
@all,
I have the same problem. Did you find a solution?
Regards, 4u
Comment #2
Khalor CreditAttribution: Khalor commentedLogin Destination respects the
<front>
token when using PHP snippet modeSo under 'Destination URL settings', set the type to 'PHP snippet' and use the following:
return '<front>';
Works for me.
Comment #3
Berliner-dupe CreditAttribution: Berliner-dupe commented@4ud
Or install "Global Redirect" - when you call domain.com/node/content (your setting homepage) you will automaticly redirect to domain.com/
Comment #4
bryanzera CreditAttribution: bryanzera commentedUsing
return "<front>"
does not work for me, inasmuch as it redirects me to the path of the homepage ('content/homepage'), not the root of the site.Comment #5
Berliner-dupe CreditAttribution: Berliner-dupe commentedInstall Module -> "Global Redirect" ... this fix this problem.
Comment #6
avinash_thombre CreditAttribution: avinash_thombre as a volunteer and commentedCheck .htaccess, apache_custom.conf file, settings.php file for any re-direction code present. Comment it or create proper exception for that. Also, check for the global redirect, redirect modules and configure it properly.
In my case, local setup /user was re-directing to home page. I found this code in apache_custom.conf file.
#Redirecting non-www to www
#RewriteCond %{HTTP_HOST} ^site\.com [NC]
#RewriteRule ^(.*)$ https://www.site.com%{REQUEST_URI} [L,R=301]
Commenting this code for time being helped access the /user. Make sure the re-directs are properly placed for live environment. Hope this helps.