Beispiel #1
0
        public bool Handle(RequestContext context)
        {
            if (_getWebpage.Get(context) != null)
            {
                return(false);
            }

            Entities.Documents.Web.Webpage webpage = _getWebpageByUrlHistory.Get(context);
            if (webpage == null)
            {
                return(false);
            }

            context.HttpContext.Response.RedirectPermanent("~/" + webpage.LiveUrlSegment);
            return(false);
        }
Beispiel #2
0
        public bool Handle(RequestContext context)
        {
            if (_getWebpage.Get(context) != null)
            {
                return(false);
            }

            var webpage = _getWebpageByUrlHistory.Get(context);

            if (webpage == null)
            {
                return(false);
            }

            var queryStringExist = context.HttpContext.Request.QueryString.Count > 0;
            var redirectUrl      = "~/" + webpage.LiveUrlSegment;

            if (queryStringExist)
            {
                redirectUrl += "?" + context.HttpContext.Request.QueryString;
            }
            context.HttpContext.Response.RedirectPermanent(redirectUrl);
            return(false);
        }