views:

131

answers:

3

I'm trying to make our (very heavily AJAX based) website more search engine friendly.

We have a system where certain urls redirect to the main page after setting session variables to change the behavior of the main page. This is acheived using the Controller.Redirect method to create an ActionResult.

So for instance, the main page is:

http://radiotuna.com

but if we want to link to a radio station, we use:

http://radiotuna.com/s/66258

which redirects to the main page. However in this case, the displayed content is different due to Session variables that were set prior to the redirect.

What will be indexed by web crawlers when presented with this redirect?

Will Session be preserved in this case?

As far as I can tell there are a few possible outcomes:

  1. crawler follows redirect, session info is preserved, crawled data is associated with http://radiotuna.com/s/66258 (the desired outcome)
  2. crawler does not follow redirect. If we can send a page with the 302, this is OK-ish. Is this permitted?
  3. crawler follows redirect, session info is preserved, crawled data is associated with http://radiotuna.com/ (bad)
  4. crawler follows redirect, but session info is discarded, so main (unmodified page) is associated with http://radiotuna.com/s/66258 (bad)

Perhaps a 302 is the wrong status to send back. Perhaps the idea of using redirects in this case is flawed. Can anyone enlighten me?

EDIT: Why are we doing this? Ideally we'd like only a single URL to appear in the address bar, so we'd like to always redirect to the main page. When coming in from a redirect, this would result in a different title and meta description and it is this that we'd like to be picked up by the crawler and associated against the pre-redirect url.

EDIT2: Would it be better to detect if we're being hit by a crawler and to deliver the page without redirect in this case? How might one detect crawler clients?

+2  A: 

you should really consider creating an xml site map and submitting it to the major search engines. you can create urls like radiotuna.com/kmtt (my local station) so it will mean something to the person who sees the url in the result. Easy enough to handle in your controller.

As for what gets indexed, search engines are finicky. If you send "permanently moved" then most engines will note the URL they found and internally update it with your new address. But why depend on them? Better to do it and control it yourself.

No Refunds No Returns
Funnily enough, it was developing sitemap functionality that led to this conundrum. We will indeed be including these "special" links in the site map, but would like them to pick up different titles and meta descriptions to that of the default main page. I'm not sure a sitemap helps for this.
spender
+1  A: 

In the case of Google, they associate a Url with a specific title and meta description. My guess is outcome 3 and outcome 4 would happen. It can be both, because the crawler may try it both ways.

If you can preserve the Url that is entered in the address bar, do it. For crawlers and for real people. Users typically don't like confusing redirects. Plus you allow the user to easily post a Url to their favorite Radio Station which will help PageRank.

Have you tried setting up Google Webmaster Tools or viewing your data in Google Analytics? The Internal Links section will give you some insight into how your site is being crawled. The Diagnostics section will also find things like duplicate title and meta tags.

James Lawruk
A: 

Thanks for the answers everyone. The big oversight here is that Session is preserved using the sessionid cookie, which, unless I'm mistaken, will not be available when the crawlers come to visit. Back to the drawing board.

spender