예제 #1
0
        public override ActionResult Index()
        {
            // detect language from browser settings
            if (!IsManaging)
            {
                var language = CurrentItem.SelectLanguage(Request.UserLanguages);
                if (language != null && language != CurrentItem)
                {
                    return(Redirect(language.Url));
                }

                if (CurrentItem.RedirectUrl != CurrentItem.Url)
                {
                    return(Redirect(CurrentItem.RedirectUrl));
                }
            }

            return(new EmptyResult()); // cannot display logical page
        }
예제 #2
0
        public override ActionResult Index()
        {
            AssertProductsLoaded();
            // detect language from browser settings
            if (!IsManaging)
            {
                var language = CurrentItem.SelectLanguage(Request.UserLanguages);
                if (language != null && language != CurrentItem)
                {
                    return(RedirectPermanent(language.Url));
                }

                if (CurrentItem.RedirectUrl != CurrentItem.Url)
                {
                    return(RedirectPermanent(CurrentItem.RedirectUrl));
                }
            }

            SetPageTitleSimple();
            return(View());
        }