tags:

views:

412

answers:

4

I have a page which dynamically loads a section of content via AJAX. I'm concerned that this means the content will not be found by search engines.

To show you what I mean, the site is at http://www.gold09.net and the dynamic content is at /speakers.php - Normally no one would visit that second link, it's just loaded into the first page.

I know I can tell the crawlers to read the speakers.php by using a sitemap.xml, but then I'll get links to the speakers.php showing up in search results.

I guess the ultimate solution would be so that if someone requests /speakers.php it redirects them to the main page, whereas it lets crawlers read the data.

Any suggestions?

A: 

This article seems to cover it: How to: Get Google and AJAX to Play Nice. Although it seems you need both an ajax and non-ajax version... :(

Chris Kimpton
+3  A: 

Make the links that point to the pages you want indexed to have a real HREF to the content - but use javascript to intercept the event and "return false;" at the end.

nlaq
the only problem is that the links are added dynamically via javascript too.
nickf
A: 

as nelson laquet said you need to provide return: false; on every anchor you have on your page without omitting their href values [as that's what's really important for screen readers like google]

it will also be cool if you use rewrite methods that would mask this:
on your server side code provide parameters for use only by your javascript codes like for example the address is

index.php?ajaxpageneeded=page1

...

<body onload="ajaxloaderscript(<?=page1?>);" >
lock
Ergh, onload? Use an event.
rmh
A: 

Update: What I've done is this:

Created another page called viewSpeakers.php which just includes the speakers.php file with the standard header and footer around it. This means that if someone goes to that site, then they'll see a vaguely attractive page. The only links to that page are in the HTML of the index.php page (where it immediately get removed via javascript) and in my sitemap.xml.

The effect of this is that the search engine crawlers and users who have javascript disabled get to see a link to information about the speakers. People who have javascript enabled get the AJAXy goodness of the data being loaded dynamically on the same index page and they never have to know about the viewSpeakers.php page.

The only downside I can forsee is that someone might come to the viewSpeakers.php page via a search listing, and then not be able to find a link back to that page from the index.php. Not really too much of a problem...

This was added as an answer, rather than editing the question, because it's one way to solve this problem. I'd still be interested to know if there's a better way than this.

nickf