I have a site where homepage "example.com" redirects to random joke(example.com/random-joke). First I redirected with php, but then google indexed that joke page(rather to be empty). I used "302 Found" status code.

Now i'll echo links to latest jokes and hide it with javascript and redirect with javascript.

But this doesn't seem to help..

  1. It seems that google still indexes joke page instead a list of jokes provided to homepage
  2. It is slower for the visitor to redirect with javascript

So does google detects javascript redirects and is there any good solution for "random redirects"?

  • 1
    What do you want Google to see on your homepage? – paulmorriss Jan 24 '12 at 14:00
  • I don't know. Something usual to google i think. My main concern is that google indexes that random joke as my homepage, just that, and if user lands to my homepage then i'd want to redirect them to a random joke. – Kristian Jan 25 '12 at 7:00

If I'm understanding correctly you want the complete list of jokes indexed as the home page, however, you only want the user to see 1 random joke when they visit the home page (My solution is based on the assumption that I'm understanding correctly).

I would place all of the content on the homepage and use CSS to build a slider for the jokes, this way all content is available to both Google and the user on the homepage but the styling emphasizes your random joke and requires action on the part of the user to switch to the next joke.

Note: You want to be careful how you format this, as Google doesn't like hidden text, this technique is in my experience pretty common so if done tastefully shouldn't be a problem.

  • Yep, tou olmost got my idea. Actually i have a sitemap of jokes for google, but what i'd like to do is to avoid google to indexing that random joke as my homepage, and maybe give google something usual to work with. But visitor redirects to a random(i'll say random to keep things simple, actually there's some logic) joke, with url changing. – Kristian Jan 25 '12 at 7:04
  • 1
    I'd still suggest not redirecting, but rather use JavaScript to display the "random" joke on the home page. Google can read some JavaScript but it's not great at it, you can read up on how to make your JavaScript "Google Friendly" and then do the opposite to keep Google from indexing the joke on the homepage. – Joshak Jan 25 '12 at 12:34

Why don't you just display the random joke on your homepage?

Or do you want Google to index something else than what your users are going to see?

The latter can become an issue since Google generally doesn't like that. Or did I completely misunderstood your question?

  • 1. I'd like to change the url without google indexing it as my homepage. I feel so repeated right now..:D More details on other comments.. 2. And no, showing something else to google is advantage, not priority. – Kristian Jan 25 '12 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.