More in this section
Forums / General Discussions / Improve SEO for custom error pages

Improve SEO for custom error pages

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
4 posts, 0 answered
  1. max
    max avatar
    2 posts
    Registered:
    28 May 2014
    28 May 2014
    Link to this post

    Hey guys, 

    I don't know if this is the right section but I would like to ask if anybody knows the answer to this little issue i am experiencing.

    so basically when page is not found the sitefinity redirects to a custom Error page (404);  by
    using Fiddler, I noticed before landing on the Custom Error Page, the page I requested gets a 302 status.

    Having 302 followed by a 404 kind of sucks from an SEO perspective.

    I guess my question is, It is possible to make the 302 into 301 instead?

     

  2. Vassil Vassilev
     Vassil Vassilev avatar
    308 posts
    Registered:
    21 Jan 2015
    29 May 2014
    Link to this post
    Hello Max,

    I could suggest to insert some code in your global.asax file. Something similar to this could do the trick:
    protected void Application_Error(object sender, EventArgs e)
    {
        Exception ex = Server.GetLastError();
        if (ex is HttpException)
        {
            var context = HttpContext.Current;
            context.Response.Clear();
            context.Response.Status = "301 Moved Permanently";
            context.Response.AddHeader("Location", "customErrorPage");
            context.Response.StatusCode = 301;
            context.Response.End();
        }
    }

    Hope this helps

    Regards,
    Vassil Vassilev
    Telerik
     
    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
     
  3. max
    max avatar
    2 posts
    Registered:
    28 May 2014
    30 May 2014 in reply to Vassil Vassilev
    Link to this post

    Thank you for the reply,

    I used the code you provided but I still receiving 302 error then 404

    FYI: I have Sitefinity 5.1 i don't know if it helps or not.

     

  4. Vassil Vassilev
     Vassil Vassilev avatar
    308 posts
    Registered:
    21 Jan 2015
    31 May 2014
    Link to this post
    Hello Max,

    Actually this should not be related with the Sitefinity version you are using. Here is a video of my test, which works as expected.

    Regards,
    Vassil Vassilev
    Telerik
     
    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
     
4 posts, 0 answered