homepage Welcome to WebmasterWorld Guest from 54.163.72.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Redirecting referrals from Google
ukubuntu




msg:3762251
 5:09 pm on Oct 9, 2008 (gmt 0)

Hi,

I have found that the way Google scans my site, that when people put in some details they get a page that has the most content of that subject. However I would prefer them to go to the home page. Is there some code that I can put on most pages that if the person has come from Google then it will redirect to the home page?

Thank you

 

dublinmike




msg:3762284
 5:50 pm on Oct 9, 2008 (gmt 0)

Maybe something like:


if(strpos($_SERVER['HTTP_REFERER'],"google")!==FALSE)
{
header("Location:/");
exit();
}

nick279




msg:3762298
 6:03 pm on Oct 9, 2008 (gmt 0)

Be Careful :)

ukubuntu




msg:3762300
 6:05 pm on Oct 9, 2008 (gmt 0)

Thank you Mike I will test it straight away. I am guessing this is php code an needs to go in the <head> section. You can tell I am a novice :$

Thanks again

ukubuntu




msg:3762306
 6:15 pm on Oct 9, 2008 (gmt 0)

I have just added it and it works like a dream. I owe you a beer, sorry if it is only virtual. Mike you are a hero :)

A

ukubuntu




msg:3762311
 6:22 pm on Oct 9, 2008 (gmt 0)

Hi Nick, what was the be careful for. When searching around unsuccessfully some have suggested about redirecting to other sites. I can see how this is unlawful if put on someone elses site or if you want to gain referral revenue from other sites, but this is genuinely legitimate. If there is a security risk please say. If Google will not scan the site then I guess I need to review it and keep a check. If you want proof I can put up the url.

Thanks, your thoughts appreciated

A

jimbeetle




msg:3762352
 7:05 pm on Oct 9, 2008 (gmt 0)

I have found that the way Google scans my site, that when people put in some details they get a page that has the most content of that subject. However I would prefer them to go to the home page.

Backing way up to the beginning: That's the way web search is supposed to work.

Searchers enter a query, the search engine returns a list of the most relevant pages, the searcher clicks a result and expects to be taken to that page. And the search engines also expect the user to be taken to that page, not a less relevant one.

I guess this would basically be called poor man's cloaking, showing one page in the SERPs and serving a different page to the searcher. The SEs don't like it and you are flirting with trouble if you keep the redirect in.

ukubuntu




msg:3762396
 8:18 pm on Oct 9, 2008 (gmt 0)

I See Jim, I had a small idea that that may be the case. However I can explain my intentions. I agree that on most sites it is the content on individual pages that people, but where I am promoting a physiotherapy practice, people are searching more for the site than the content.

Example: Search term Marlborough Physio - message and link = In addition to his work at the clinics he is also the physiotherapist for Marlborough College, with patients aged between 13 and 18 years, all of whom are ...
www.example.com/staff.php - 15k - Cached - Similar pages

This links to the staff pages when someone was searching generally. if you now link to www.example.com/staff.php from Google, it thankfully redirects to the home page. I would be happy to add other major search engines if able, to make it fair.

Do you think I should mail Google?

[edited by: eelixduppy at 8:42 pm (utc) on Oct. 9, 2008]
[edit reason] exemplified [/edit]

jimbeetle




msg:3762415
 8:38 pm on Oct 9, 2008 (gmt 0)

No, it really doesn't work that way, ukubuntu. The search engines expect the page that appears in the results to be the page the searcher lands on. Anything else might be confusing to the searcher, resulting in a bad user experience, resulting in a lost searcher. This practice is strictly against all SE guidelines.

Let's take a look at what you said in your first post: "they get a page that has the most content of that subject."

What that should tell you is that you have to do some basic search engine optimization to make sure the home page is returned for that page. Maybe examine why the sub-page is appearing instead of the home page. What makes it more relevant for the search term than the home page? Maybe adding more relevant content to the home page might help; maybe it's the link structure of the site.

And you know, now that I took a look from the hints you dropped, the home page should not be appearing for that search term -- it is not at all relevant to the query. Please, do yourself a favor: as long as one page of the site is being returned, be happy. Then take that redirect off as soon as you can.

[edited by: eelixduppy at 8:13 pm (utc) on Oct. 10, 2008]
[edit reason] fixed styling [/edit]

MadeWillis




msg:3762418
 8:44 pm on Oct 9, 2008 (gmt 0)

Why not put the content you want the user to see on the page that is ranking? That is, assuming you haven't been dropped from the main index yet.

[edited by: MadeWillis at 8:44 pm (utc) on Oct. 9, 2008]

ukubuntu




msg:3762443
 9:29 pm on Oct 9, 2008 (gmt 0)

Thanks to you all, I appreciate the whole picture. I have taken the code off for the moment, but I will look into the complete ramifications and perhaps try to contact Google to see their view.

My thanks again

jimbeetle




msg:3762452
 9:43 pm on Oct 9, 2008 (gmt 0)

Why not put the content you want the user to see on the page that is ranking?

The content *is* on the page that is ranking, that's why it comes up in the SERPs.

But ukubuntu wants the home page, one not relevant to the query, to appear. And as I said above, the site's home page, as it stands now, should not, no way in heck, rank for that term. And actually, the site itself really isn't relevant for that term except in the way the one page is being returned.

ukubuntu




msg:3762483
 10:34 pm on Oct 9, 2008 (gmt 0)

Jim is correct. The issue is that the page ranks because the terms searched for are repeated several times more than on the home page. I have the words Physio and Marlborough on the home page but this does not rank. To place the text numerous times on the home page would probably start to detract in more ways than one. I have used META info to help but so far, no bananas!

Do not fret. Compromise and workarounds will prevail in time.

nick279




msg:3762763
 10:03 am on Oct 10, 2008 (gmt 0)

what was the be careful for

ukubuntu - have a read of google's webmaster guidelines

Make pages primarily for users, not for search engines. Don't deceive your users or present different content to search engines than you display to users, which is commonly referred to as "cloaking."

Not that I'm saying you are decieving - but if for some reason Google sees it that way, you could possibly be acting against their guidelines.

Potential problem I can see - someone visits directly example.com/page and get content (a), but if they come in through Google to the same page, they get redirected to example.com/ and see content (b), Google may not understand your reasoning for this.

ukubuntu




msg:3762942
 2:18 pm on Oct 10, 2008 (gmt 0)

Yes, it is a quintessential dichotomy!

:)

Thanks for the look up. I do see the point.

MadeWillis




msg:3762962
 2:57 pm on Oct 10, 2008 (gmt 0)

But ukubuntu wants the home page, one not relevant to the query, to appear.

My thoughts here were obviously you have a reason to want your visitors to go to your homepage rather that the current ranked page. Okay, but why is that? What is it on your homepage that makes you want the visitors to go to that page instead? Add that content to the page that does rank if it's so important.

ukubuntu




msg:3762996
 3:32 pm on Oct 10, 2008 (gmt 0)

The reason is...

The website is a site promoting a physiotherapy practice. Not an information site about practices or a thorough encyclopedia documenting all elements of the discipline. Yes there are helpful pages for specific conditions but they would not need the redirect. I am guessing that 95% visitors to the site are seeking therapy. They would not have known the site previously otherwise they would hove put the base url in the address bar. So in the example I gave, if I put "KEYWORD" in Google, it comes up with the Staff page. If I put the information about all the staff members on the Home page it would be inappropriate. I can see that I can try to increase certain words on the homepage, and maybe this will improve results, but searching for individual practitioners is not what the site is for. As I suggest, the issue will be resolved, and I can see how using such code could be seen to be mischievous but the intentions were appropriate.

Thanks for the interest. I am glad of all comments.

[edited by: eelixduppy at 8:16 pm (utc) on Oct. 10, 2008]
[edit reason] specifics [/edit]

MadeWillis




msg:3763024
 3:55 pm on Oct 10, 2008 (gmt 0)

Okay, makes sense to me now.

Something else you could try is where ever you use the keyword "KEYWORD" on other pages of your site, use this as anchor text and point the link to your homepage. One link may not affect ranking too much, but if you have multiple occurances, it could help. Making any changes like this can take several months to have any affect.

[edited by: eelixduppy at 8:17 pm (utc) on Oct. 10, 2008]
[edit reason] specifics [/edit]

jimbeetle




msg:3763083
 4:54 pm on Oct 10, 2008 (gmt 0)

This discussion is getting a bit too detailed for WebmasterWorld, so let's expect it to be heavily edited. Generalities are best.

That said, your problem ukubuntu, is that while the domain name is this, the title of the site is that. Nowhere, except on that page that is ranking for the term, do the domain name keywords appear. Somebody has to make a decision as to what term is being targeted: "domain name" or "widget & associates".

eeek




msg:3763421
 3:43 am on Oct 11, 2008 (gmt 0)

I would prefer them to go to the home page

If I got redirected to your home page, I'd most likely ignore your site. At best it's just plain rude.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved