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.
I am trying to set the redirection condition for only the front page and am having some trouble - i.e. I only want redirection to occur if a user logs in from the front page. I know I need to create some type of boolean value for but I'm inept at php and could use some help. Anyone have any ideas? Thanks.
Comments
Comment #1
rsvelko CreditAttribution: rsvelko commentedComment #2
Khalor CreditAttribution: Khalor commentedAny chance we could work on this? The
<front>
variable exists if using PHP snippet mode for redirection, but that's a pretty weird format for a PHP variable, and it's tough to know what it returns/what to compare it against to return the correct boolean value for front-only redirection.Comment #3
Khalor CreditAttribution: Khalor commentedupdating to current version
Comment #4
mithy CreditAttribution: mithy commentedSure we can. In the meanwhile try something like this:
return drupal_match_path($_GET['q'], variable_get('site_frontpage', 'node') );