Try Now
More in this section

Forums / General Discussions / 301 Redirect to External Page

301 Redirect to External Page

2 posts, 0 answered
  1. Alycia
    Alycia avatar
    1 posts
    16 Feb 2009
    03 Sep 2014
    Link to this post

    I'm running Sitefinity 7 on IIS 7.  I currently have a bunch of documents in my Sitefinity library that will be moved to a different domain.  I need to create 301 redirects for the Sitefinity document URLs to the new domain.    How do I create a redirect to an external domain for a former Sitefinity URL?  Is this done using IIS URLRewrite? Or something within Sitefinity itself?


  2. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    24 Oct 2016
    08 Sep 2014
    Link to this post
    Hi Alycia,

    You can handle the redirects as in any traditional ASP.NET application in the Global.asax file or by defining rewrite rules in the web.config file. I found the following articles related to redirecting in ASP.NET which might be useful to you:

    1. http://stackoverflow.com/questions/10673303/301-redirect-in-asp-net-4-0
    2. http://www.sitefinity.com/developer-network/forums/deployment--/redirects
    3. http://www.sitefinity.com/documentation/documentationarticles/installation-and-administration-guide/create-a-project/creating-and-running-projects-on-iis/using-url-rewrite-for-seo

    For example, in order to redirect your users from a page of your site domain.com to a different domain you can check the URL in Application Begin Request method in the Global.asax file and redirect to the new location:

    var RedirectString = "newdomain.com/file.pdf";
    if (HttpContext.Current.Request.Url.ToString().Contains("domain.com/docs/default-source/pdfs/file.pdf"))
        Response.StatusCode = 301;
        Response.AddHeader("Location", RedirectString);

    The code above checks if the url is "domain.com/docs/default-source/pdfs/file.pdf" the user is redirected to new location of the file as specified in the RedirectString variable.

    I hope the above information helps.

    Sabrie Nedzhip
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 0 answered