Redirect 301 for seo
Is it possible identify if the google links are wrong and make a redirect 301 or 302 on the server? Previously without dotnet javascript service I did in the node like :
constructor( @Inject('response') private _response: any, @Inject('isNode') private _isNode: boolean ) {}
public redir301(location: string): void { if (this._isNode) { this._response.redirect(301, location); } }
You'd have to have some kind of a Service triggered when a 404 comes, and in your main.server file, when you get your Html result etc, you'd probably want to return something else instead... maybe a StatusCode / etc. Then in your HomeController look to see if that statusCode is there, and do a server Redirection (instead of rendering the angular app client-side 404).
Hope that helps! Let me know if you make any progress on that, we could put in an example of it for others to see if they need it.
I used Meta servise to set meta tag with http response code.
Then I parsed it from asp and set in in response.
Now that we have #179 that has the REQUEST etc you should be able to handle this that way, or as Boris pointed out, and just set something or a specific response you can look for when you get the Result back in .NET from prerendering, and handle your Redirect there (instead of returning the View).
Hope that helps!