We are working in a project that uses Symfony2 + AngularJS in each separate domain (API. Domain Symphony 2 and www.domain for the Commonwealth Project).
Now we are focusing on the SEO Part.
But the problem occurs when Angle serves "404 pages":
$ UrlRouterProvider Otherwise ('/ 404');
The thing is, what we do is redirecting a new page to our "404 page" with a 200 page header status code, Very bad for purposes ...
Since fingers are not capable of producing, we have already tried two things:
1 Use a redirection with HTX / Apache:
Redirects mail 404 "/ 404"
2 web service W Call that returns us 404 error:
& lt ;! DOCTYPE HTML PUBLIC "- // IETF // DTD HTML 2.0 / EN" & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; 404 Not Found & lt; / Heading & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; H1 & gt; Did not get & lt; / H1> & Lt; P & gt; The requested URL / do-not-access was found on this server. & Lt; / P & gt; & Lt; / Body & gt; & Lt; / Html & gt;
And for the AngularJS side, we tried to throw the header status code without success:
Return to $ http.get (ENV.apiEndpoint + '/ Do) -not use');
None of these work for us ...
We use a second "404 page" There are also. This idea was redirecting our 404 pages to 404 pages through HTACs with a 404 status code, but we think this AngularJS will not work because of internal redirection:
< Code> 200 - & gt; 301 - & gt; 404
PS: I found that: "We have to configure our server to make routing exceptions for our custom 404 page" but we do not have any clue how to do this Is ...
Are we focusing in a bad way?
Is there any other option?
How can we handle it?
Any thoughts? It seems that prerender.io
It looks like prerender For example, for 404 pages , we should add this meta tag to our main tag :
/ P>
& lt; Meta name = "prerender-status-code" content = "404" & gt;
Docs:
No comments:
Post a Comment