admin管理员组文章数量:1384994
probably duplicate question Best way to set up 404 pages in a angular SPA? but I didn't find a reliable answer for my question .
I'm curious to know if there is a way to tell googlebot about a 404 page ?
there is a tag for this purpose called prerender-status-code but I'm didn't find any official article from Google Seo Team to confirm that they respect this meta tag .
is this enough to follow the best practice specify in here ?
or should I do something more ? (perhaps something to do with Google Webmaster tools ?)
I do a research on a few well known SPAs and I noticed SoundCloud add a nofollow tag on their 404 pages , like this :
<meta content="noindex, nofollow" name="robots">
does googlebot respect a meta tag which has been added later by js ?
probably duplicate question Best way to set up 404 pages in a angular SPA? but I didn't find a reliable answer for my question .
I'm curious to know if there is a way to tell googlebot about a 404 page ?
there is a tag for this purpose called prerender-status-code but I'm didn't find any official article from Google Seo Team to confirm that they respect this meta tag .
is this enough to follow the best practice specify in here ?
or should I do something more ? (perhaps something to do with Google Webmaster tools ?)
I do a research on a few well known SPAs and I noticed SoundCloud add a nofollow tag on their 404 pages , like this :
<meta content="noindex, nofollow" name="robots">
does googlebot respect a meta tag which has been added later by js ?
Share Improve this question edited May 23, 2017 at 12:18 CommunityBot 11 silver badge asked Mar 14, 2016 at 14:17 Mahdi ZareieMahdi Zareie 7537 silver badges19 bronze badges 1- Check, stackoverflow./questions/37334220/…. Just answered. – Mauro Commented Jan 30, 2018 at 14:55
2 Answers
Reset to default 4You can dynamically add a meta tag in your 404 ponent:
import { Component } from '@angular/core';
import { Meta } from '@angular/platform-browser';
@Component({
selector: 'app-notfound',
templateUrl: './notfound.ponent.html',
styleUrls: []
})
export class NotFoundComponent {
constructor(private meta: Meta) {
meta.addTag({ name: "robots", content: "noindex" });
}
Google do it themselves on the angular.io site: https://github./angular/angular/blob/7b56daffe68c1874ece7ac3b5e252e1edfed980a/aio/src/index.html
The only way to tell google bot that this is 404 page is to send http status code 404.
Regarding of prerender-status-code. It seems that you've read it on prernder.io. The real idea behind this meta tag is to tell prerender what is the page code it need throw to client. So you can control whether to send 404 (or any other code) depending of logic of your js application. You can read a bit more here https://github./prerender/prerender/issues/347
I hope that after this Advanced google bot will be implemented we all will be able to have a deep breath! https://webmasters.googleblog./2017/12/rendering-ajax-crawling-pages.html
本文标签: javascriptHow to notify GoogleBot about 404 pages in Angular SPAStack Overflow
版权声明:本文标题:javascript - How to notify GoogleBot about 404 pages in Angular SPA? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744538809a2611482.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论