Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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"?

share|improve this question
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
add comment

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
    
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
    
Thanks for your help :) –  Kristian Jan 26 '12 at 11:04
add comment

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?

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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