Best Practice for SEO and < IE9

There might not be a perfect answer to this, but I can’t find any documentation / blogs addressing this directly.

Issue: I need to support IE8 (which my Ember app does fine), and also have SEO.

I really like Evil Trout’s blog post on SEO. However, Discourse does not support < IE9.

That blog post recommends noscript tags, coupled with the history API. This allows for really nicely optimized content for SEO, preloaded data, etc. Works great for Discourse, and seems very clean / simple.

But it doesn’t work for older browsers.

Another option would be to use Brombone or any other similar service. This would use the hashbang syntax (#!), and use PhantomJS to serve cached, static pages to Google, etc. I think this is a bit hacky in nature, but pretty easy, and would work for all browsers. But then you lose out on some of the nice, preloaded data capabilities that discourse is able to provide.

I guess a third option (which I see less documentation on), would be a combination of the Discourse approach and standard hash approach – using a fallback for older browsers. This would use noscript content for SEO, and support full capabilities of newer browsers. However, there would be duplicate urls (with and without hash).

So to sum up options (that I can think of):

  1. Discourse Approach (Push state; SEO through noscript tags; no IE9)
  2. Brombone Approach (Cached, static content; hashbang)
  3. Combo Approach (Discourse + hash fallback for older browsers)

Is there anything else that I am not thinking of? Has anyone had any luck with SEO + legacy browser support?

I would really like to hear the opinions / recommendations of some people on the core team, etc.

4 Likes

I’ve actually hit this same issue at work. We’re going with option 3, but are doing some Ember.Location hacking while we build out the app and will go back to implement a Hash Location redirect via the Rails controllers based on UA string sniffing for browsers we support that we know don’t have History API support. Those browsers specifically being IE8/9.

Here’s an example of the Ember.Location implementation. Please excuse the coffeescript. :wink:

https://gist.github.com/rogeruiz/9424906

1 Like

Hi @rogeruiz I’m interested to see your example! :slight_smile: Maybe you missed pasting it in?

Strange. Here’s the gist: https://gist.github.com/rogeruiz/9424906

I just ran into a pretty significant gotcha with the “Discourse approach”.

It seems that Google is now executing JS while crawling, so what’s happening is that it follows a JS link, but still sometimes uses the (now stale!) “noscript” content to choose a page title.

I made a more in-depth comment about it on EvilTrout’s blog post here: http://fishtank.eviltrout.com/t/adding-support-for-search-engines-to-your-javascript-applications/22/12?u=elsurudo

If anyone has any ideas on how to best handle this, I’d love to hear them.

Can you use the robots.txt ?

Hmm, what do you mean, more specifically? I know I can use robots.txt to prevent crawlers from indexing my pages, but I do want them to index my pages. It just turns out that Google is doing it incorrectly right now.

Is there something more granular you can suggest with robots.txt? Somehow prevent Google from crawling the JS, perhaps?

Is everyone aware of the new auto location? It seems like it might solve this problem for you: