homepage Welcome to WebmasterWorld Guest from 23.20.220.61
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Google / Google SEO News and Discussion
Forum Library, Charter, Moderators: Robert Charlton & aakk9999 & brotherhood of lan & goodroi

Google SEO News and Discussion Forum

    
Extra url variables added to homepage link in Google SERPS
JesterMagic




msg:4558296
 3:12 pm on Mar 25, 2013 (gmt 0)

I have noticed that a couple of my home page links in the Google Results have url variables added that didn't come from my site.

The variables are not used so therefore ignored and my site just displays it's homepage.

What I don't want to happen here is a duplicate content issue. Obviously someone has for some reason linked to my site with this url either on purpose or mistake and Google has found it and spidered the page.

Is this a cause for any concern?

 

netmeg




msg:4558327
 4:38 pm on Mar 25, 2013 (gmt 0)

Is there any pattern to them?

rainborick




msg:4558332
 4:48 pm on Mar 25, 2013 (gmt 0)

If your home page is indexed with several different query strings attached, it can cause duplicate content issues. Generally, Google resolves these on its own over time, but it's best to take some action to repair this problem quickly.

You can set up 301 redirects to remove the query strings. You can tell Google to ignore these query string parameters through the Webmaster Tools console. You can add a rel="canonical" tag to your main page. Any or all of these steps will help. The 301 redirect is probably the best and most recommended solution. I've had good results with the rel="canonical" tag for this particular problem. The Webmaster Tools setting is also a good idea because it also repairs any other URLs from your site that might have been indexed with the same query string variables. Bing has a similar query string tool.

Ribs n Blues




msg:4558354
 5:43 pm on Mar 25, 2013 (gmt 0)

Have been seeing these as well.

I added the following php code to the header file on my sites, that executes before the html is output:

################# QUERY CHECK ###################
$url = "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
$parts = parse_url($url);
$url = "http://" . $parts["host"] . $parts["path"];
if (!empty($_SERVER["QUERY_STRING"])) {
header("Location: " . $url, true, 301);
exit;
}
define("CANONICAL", $url);
#################################################


The constant, CANONICAL, is defined with the url, AFTER it's cleaned of any query strings (my site(s) do not use query strings) and then used in the head tag:

<link rel="canonical" href="<?php echo CANONICAL;?>">

Hope that helps.

TheOptimizationIdiot




msg:4558360
 6:03 pm on Mar 25, 2013 (gmt 0)

Looks like a bunch of extra processing to check for and strip a query string to me. (The above looks like it will also miss /location.ext? -- no variables or info -- since in that case the query string is empty, but the ? does make the URI a different location.)

if(strpos($_SERVER['REQUEST_URI'],'?')!==FALSE) {
header("Location: http://www.example.com" . str_replace('?'.$_SERVER['QUERY_STRING'],$_SERVER['REQUEST_URI']), true, 301);
exit;
}
###

define("CANONICAL", $url);

I'd definitely recommend against this. A long time ago when the canonical was first introduced I ran into issues on pages with www and without both being declared as the canonical since it was flexible (determined by the page location) and there was an issue in the .htaccess that skipped the canonicalization in some instances.

Much better to hard-code a canonical (www.example.com at least) or "build it" out of the information like you would the page if the site is dynamic and not rely on everything working 100% the way it should to not have every page with the information presented declared as the canonical version of the page, because when everything works the way it should the canonical is unnecessary since there's only one version of the page and a canonical should point from the non-canonical location to the canonical location like a 301 redirect would.

Basically, if you code the canonical to be flexible based on the location a visitor is viewing and you have any duplication you have multiple canonical locations. If you don't have any duplication you don't need the canonical since there's only one version of the page, so obviously it's the canonical.

TheOptimizationIdiot




msg:4558385
 6:52 pm on Mar 25, 2013 (gmt 0)

I should add I wasn't trying to "jump on you" or the code you posted Ribs n Blues, so sorry if it came out that way. There's just a number of "little issues" that people could think are fixed but really aren't if they use it and hopefully my post helped you too.

JesterMagic




msg:4558585
 1:20 pm on Mar 26, 2013 (gmt 0)

Thanks for the thoughts on the issue.

I think I may go with the redirect for now as it appears to be just a few urls. The site also contains a blog which I use canonical links on the posts.

The home page is made up of some unique text describing the site followed by a number of featured blog posts. I don't want Google to get confused with me adding canonical link on the home page with text that appears under another link that is also a canonical link.

Does anyone have a recommendation on how to find who ever linked to my site this way? I checked GWT and didn't find anything.

phranque




msg:4558586
 1:29 pm on Mar 26, 2013 (gmt 0)

welcome to WebmasterWorld, Ribs n Blues!

where've you been for 5 years?
=8)

JesterMagic, there are several link intelligence tools out there that might reveal this information, but i would start with your server access log to see if any requests for these urls have been referred from other sites.

JesterMagic




msg:4558641
 4:30 pm on Mar 26, 2013 (gmt 0)

@phranque - I have checked the logs back 5 months and the only thing I see is it coming from Google search or Google bot

I have used Majestic SEO before does anyone have other recommendations or is it still the best?

netmeg




msg:4558670
 5:56 pm on Mar 26, 2013 (gmt 0)

I love Majestic, but lots of people I know block them, so I wouldn't consider them to be the end-all be-all. Frankly, it's probably a waste of your time to worry about who's linking this way. I get this stuff all the time, and mostly I just ignore it. If I see one often enough, I'll redirect it, but overall it's not a huge concern (and I just don't have the time)

netmeg




msg:4558693
 7:12 pm on Mar 26, 2013 (gmt 0)

(I should have added, unless you see a ton of them, and then you need to start investigating)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Google / Google SEO News and Discussion
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