infinite redirect problem -- followup
| Project: | CustomError |
| Version: | 5.x-1.2 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I've been trying to get customerror to let me send anonymous users back to my site's home page when they hit missing pages. (Long story omitted; in context, it's not as bad an idea as it might seem.) I'm writing the php code to check for whether the user is logged in and, if he's not, do a drupal_goto(''). My problem is that I'm getting redirected back to the page that originally 404'ed -- I can see the multiple calls in the server logs -- and the browser eventually gives up on the infinite redirect.
I've seen the posts about how Global Redirect can get in the way of all this, and so I've disabled Global Redirect and Pathauto on my site (they were in fact installed). However, the problem remains. Can anyone offer any advice? Thanks.

#1
For what it's worth, I've been able to get the behavior I wanted by doing:
unset($_REQUEST['destination']);before calling drupal_goto. But if there's a more principled way of handling this issue, it would be good to know about it.