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:
but if we want to link to a radio station, we use:
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:
- crawler follows redirect, session info is preserved, crawled data is associated with http://radiotuna.com/s/66258 (the desired outcome)
- crawler does not follow redirect. If we can send a page with the 302, this is OK-ish. Is this permitted?
- crawler follows redirect, session info is preserved, crawled data is associated with http://radiotuna.com/ (bad)
- 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?