diff --git a/modules/context/auth.go b/modules/context/auth.go index 372bcb187..c38cc3948 100644 --- a/modules/context/auth.go +++ b/modules/context/auth.go @@ -37,12 +37,6 @@ func Toggle(options *ToggleOptions) macaron.Handler { return } - // Check non-logged users landing page. - if !ctx.IsSigned && ctx.Req.RequestURI == "/" && setting.LandingPageURL != setting.LandingPageHome { - ctx.Redirect(setting.AppSubURL + string(setting.LandingPageURL)) - return - } - // Redirect to dashboard if user tries to visit any non-login page. if options.SignOutRequired && ctx.IsSigned && ctx.Req.RequestURI != "/" { ctx.Redirect(setting.AppSubURL + "/") diff --git a/routers/home.go b/routers/home.go index 5bb353c7e..b92b88ef8 100644 --- a/routers/home.go +++ b/routers/home.go @@ -42,6 +42,10 @@ func Home(ctx *context.Context) { user.Dashboard(ctx) } return + // Check non-logged users landing page. + } else if setting.LandingPageURL != setting.LandingPageHome { + ctx.Redirect(setting.AppSubURL + string(setting.LandingPageURL)) + return } // Check auto-login.