'Handles help requests.'

def _HandleHelp(self, request):

    help_path = request.path.split('/', 2)[(-1)]
    if (not help_path):
        raise werkzeug_exceptions.Forbidden('Error:    Invalid    help    path.')
    try:
        user_record = aff4.FACTORY.Open(aff4.ROOT_URN.Add('users').Add(request.user), aff4_users.GRRUser, token=self._BuildToken(request, 60))
        settings = user_record.Get(user_record.Schema.GUI_SETTINGS)
    except IOError:
        settings = aff4_users.GRRUser.SchemaCls.GUI_SETTINGS()
    if (settings.docs_location == settings.DocsLocation.REMOTE):
        return self._RedirectToRemoteHelp(help_path)
    else:
        return werkzeug_utils.redirect(('/local/help/%s' % help_path))
