Welcome to WebmasterWorld Guest from 184.73.112.180

Extra url variables added to homepage link in Google SERPS

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

10+ Year Member



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?
4:38 pm on Mar 25, 2013 (gmt 0)

WebmasterWorld Senior Member netmeg is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Is there any pattern to them?
4:48 pm on Mar 25, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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.
5:43 pm on Mar 25, 2013 (gmt 0)

5+ Year Member



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.
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.
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.
1:20 pm on Mar 26, 2013 (gmt 0)

10+ Year Member



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.
1:29 pm on Mar 26, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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.
4:30 pm on Mar 26, 2013 (gmt 0)

10+ Year Member



@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?
5:56 pm on Mar 26, 2013 (gmt 0)

WebmasterWorld Senior Member netmeg is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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)
7:12 pm on Mar 26, 2013 (gmt 0)

WebmasterWorld Senior Member netmeg is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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

Featured Threads

Hot Threads This Week

Hot Threads This Month