0
votes

I have a project in meanjs.

It has html5mode disabled so my URLS are like that:

http://localhost:3000/#!/products

I am trying to implement AJAX snapshoots in order to allow Google Crawlers to see content generated by javascript on client side.

I installed a module called MEAN-SEO:

http://blog.meanjs.org/post/78474995741/mean-seo

Now when I access the following URL:

http://localhost:3000/?_escaped_fragment_=

I am redirected to:

http://localhost:3000/?_escaped_fragment_=/#!/

And when I click on "products" or when I access directly, I am redirected to:

http://localhost:3000/?_escaped_fragment_=/#!/products

After reading the Google specification detailed here https://developers.google.com/webmasters/ajax-crawling/docs/getting-started , what I need is to get is something without hashbangs, like the following:

http://localhost:3000/?_escaped_fragment_=/products

What I am doing wrong? Kind Regards.

1
looks like a routing problem is mean-seo properly installed on server as in adding the code fragments into express.js? app.use(seo({ cacheClient: 'disk', // can also be 'redis' but not sure if needed // redisURL: 'url/port', if we were actually using redis cacheDuration: 2 * 60 * 60 * 24 * 1000, // in ms, so I think this is currently set to 2 days }));Leo

1 Answers

0
votes

Any specific reasons why you want html5mode off?

Here is something a lot of people have missed: Search engines (both Google and Bing) can now handle AJAX based content.

Their crawlers now understands pushstates, so if you just turn html5mode on you don't need any special handling to get your SEO working. You can load your content via AJAX, you can set title tags and meta tags with javascript and so on and so forth, and the crawlers will understand your content the same as if you had rendered things server-side. There is no need to do html-snapshotting or escaped_fragment handling for SEO anymore.

This has been announced on their developer blogs but unfortunately most of the documentation hasn't been updated with this information, so it's gone under the radar for a lot of people.


One word of warning though, Facebook does not handle pushstates, so if you want to support the Facebook crawler you still need to handle that separately.