I have a question about redirecting the user from google search results to a desired page. To make myself clear. I have content on several pages that might come up in the search result a user run on google. However, I would like the user to arrive actually at the home page of my website. I am not sure which method to use in order to do so... I am familiar with php programming but don't have a really good idea what should be a good way to start build a code that will deal with this. I'll appreciate your suggestions to specific methods or previous threads/reading materials dealing with this issue thanks
put this on your desired page, before any output is sent: if (strpos(strtolower($_SERVER['HTTP_REFERER']),'google.co')) { header('Location: http://www.example.com'); exit(); } PHP:
does it mean that if googlebot will arrive at this page it will be redirected at a different page? I wouldn't want that to happen
Since you're familiar with PHP you can understand this page from the PHP.net php manual If the "host" parametr contains the string "google", you redirect the user depending on the "query" value or whatever you want...
of course not, the code checks for the Referer header. (whether it contains the string "google.co" in it) if googlebot visits your site, the Referer header will not contain google.co (googlebot does not search google, it simply crawls the links)
You are looking for "trouble". You want that your users get redirected to your home page while googlebot just crawl that original page. This is black hat SEO, because you want to fool google bot. You are risking to lose ranking with this kind of tricks. Remember: when you want a bot to see a different page from the page that a normal user is seeing, that is cheating. At least for google. To do that is very easy. just check the User Agent. When you see googlebot you do nothing; when you see any other agent, just redirect. Use at your own risk