Sitecore uses “302 found” to redirect users to my custom 404 page - is that legitimate?

后端 未结 3 1607
花落未央
花落未央 2021-01-05 10:57

This is more of a HTTP spec question than a Sitecore question.

I have a 404 error page set up in Sitecore:



        
3条回答
  •  醉酒成梦
    2021-01-05 11:26

    That is a problem indeed. Because google will now think the 404.aspx page does not exist and will think the non-existing item is temporarily redirected.

    I came up with a solution for this and blogged about it here.

    What it does basically is determine that the item is non-existing (through a pipeline processor), then retrieve the contents of the 404 page by requesting it using a WebRequest and return that contents to the browser with a 404 status code.

提交回复
热议问题