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:
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?
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.
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.
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.