Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Klaus Bergh 8 posts 76 karma points
    Nov 07, 2017 @ 19:50
    Klaus Bergh
    0

    Redirect to external page umbraco 7.0

    Hi

    I need some help with redirecting in umbraco.7.0 I had created a datatype with a simple textbox. and also a simple template with the following code. But it only redirect in Google chrome not in explorer, firefox, what have i doing wrong?

    @inherits UmbracoTemplatePage
    

    @{ Layout = null;

    var redirectUrl = Model.Content.GetPropertyValue<string>("externalURL");
    if (!string.IsNullOrWhiteSpace(redirectUrl))
    {
        Response.Clear();
        Response.StatusCode = 301;
        Response.StatusDescription = "Found";
        Response.RedirectLocation = redirectUrl;
        Response.End();
    }
    

    }

  • Chriztian Steinmeier 2706 posts 8117 karma points MVP 3x admin c-trib
    Nov 07, 2017 @ 21:52
    Chriztian Steinmeier
    0

    Hi Klaus,

    I don't think it's the reason, but a 301 redirect should have the text "Moved Permanently" associated with it — "Found" usually goes with a 302 redirect...

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft