Just got html snapshots working with the help of html-snapshot node module & following htaccess.
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
RewriteRule ^(.*)$ /snapshots/%1? [NC,L]
It is an angular application, but the question is universal to javascript spas/seo. Looked around the web found a good amount of articles but nothing complete which is surprising since seo is pretty important. In any case 3 questions
Using google fetch to confirm the proper outcome
The rendering of the snapshot pages: Is the intention not to worry about the css or images or possible layout issues. For example, here is an example of a page of mine. The links and the main content are overlapping each other. Is that something we should be concerned about?
Orange warming redirected label: This message is only warning us of the expected redirect, not that there is an issue that need to fix? See image
Submit to index: Should we? My first assumption was not to and just make sure site and that is submitted.
_escaped_fragment_
is not recommended any more: webmasters.googleblog.com/2015/10/…_escaped_fragment_
. Don't use<meta name="fragment" content="!">
. Do use the History API. When the browser directly requests/foo/example
(e.g. from a link from an external site, or a bookmark, or the user typing the URL) then do generate the HTML for entire page on the server. When a user follows a link on your site to/foo/example
then use JS to transform the DOM to match what the server would render and usepushState
to set the URL to/foo/example
so that you don't have to load the whole page.