Fix bug when using direct link with custom pages - refs CT#7371