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 ?
You can dynamically add a meta tag in your 404 component:
import { Component } from '@angular/core';
import { Meta } from '@angular/platform-browser';
@Component({
selector: 'app-notfound',
templateUrl: './notfound.component.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.com/angular/angular/blob/7b56daffe68c1874ece7ac3b5e252e1edfed980a/aio/src/index.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With