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..It seems that google still indexes joke page instead a list of jokes provided to homepageIt is slower for the visitor to redirect with javascriptSo does google detects javascript redirects and is there any good solution for random redirects?
Google and random redirects
seo;google;php;javascript;redirects
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.