如何使盖茨比的自定义404页返回404状态代码
我有一个自定义的404页,它的工作正常。当用户存在不存在的URL时,可以说example.com/abcd
,将它们重定向到404自定义页面。但是404自定义页面具有200个状态代码,这对SEO不利。当我阅读一些信息时,这是正常的行为,因为404页存在。
但是,有没有机会让此页面返回404状态代码?
Gatsby版本为2.17.11。
I have a custom 404 page and its working fine. When the user has a non existed url, lets say example.com/abcd
, they are redirected to the 404 custom page. But the 404 custom page has 200 status code, that is not good for SEO. And as I read some information, this is normal behaviour because the 404 page exists.
But is there any chance to make this page to return 404 status code?
Gatsby version is 2.17.11.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论