You are not logged in.
Pages: 1
This is arguably a bug: http://www.designcollective.com/%20 and http://www.designcollective.com/ serve the same content.
I picked the above as an example BigTree install. We are on 4.2 and have the same problem.
The real-life consequence is that the moment someone linked us with a trailing space, Google picked it up as "duplicate content". This is now harming our search standing.
An immediate 301 to the real URL with whitespace stripped seems like the solution, but perhaps there are better ways to fix this.
Best,
Tushar
Offline
This seems to be the result of how MySQL treats string storage/comparison:
http://stackoverflow.com/questions/7455 … r-does-not
The easiest way to resolve this for SEO purposes is to set canonical URLs in your headers:
https://support.google.com/webmasters/a … 9066?hl=en
I'd generally do something like this as it will ignore the canonical tag for routed templates (since they accept sub-routes you don't necessarily want Google to only list the top level page):
<? if (!$routed) { ?>
<link rel="canonical" href="<?=WWW_ROOT.$bigtree["page"]["path"]?>/" />
<? } ?>
I believe $routed should exist in your header unless that variable is changed inside a template (it's not really an environment variable, just happens to be set in the router). If it was modified in the template you'll need to do something like this to check the routed-ness instead:
$template = $cms->getTemplate($bigtree["page"]["template"]);
if (!$template["routed"]) {
Offline
This fix is inserting the right canonical tag in the home page, thanks!
To document the entire change: in templates/layouts/_header.php, after the title tag, add:
<? if (!$routed) { ?>
<link rel="canonical" href="<?= preg_replace('/\/*$/', '', WWW_ROOT.$bigtree["page"]["path"]) ?>/" />
<? } ?>
Last edited by tsamant (June 11, 2015 4:50pm)
Offline
Pages: 1