I'm using this first child redirect on a few of my sites. Maybe it's a better fit for most situations as it takes into account if the child is actually published and not hidden and also marks the redirect as temporary (because the first child most probably changes over time). What do you think?
// if current page has children (published, not hidden), redirect (HTTP 302) to its first child
if($pages->count("parent=$page")) $session->redirect($page->child->url, false);
I'm using this first child redirect on a few of my sites. Maybe it's a better fit for most situations as it takes into account if the child is actually published and not hidden and also marks the redirect as temporary (because the first child most probably changes over time). What do you think?