regarding http://googlewebmastercentral.blogspot. ... nical.html
Mods to 1.11.2 to support this:
In index.php
within function readTemplate() {
after
after
If you use custom parameters in the URL, as I do, and need to include these, you can add something like this between those two lines:
You will also need to adjust your template.html file for whatever layouts you use. Just add
This ensures that your pages only appear once in Google search results, and all popularity scores etc are amalgamated across the various forms that the url can take, e.g.:
http://www.example.com/
http://www.example.com/index.php
http://www.example.com/index.php?cat=10_Hello
http://www.example.com/index.php?cat=10 ... 10_Welcome
are all treated as the same page.
HTH.
Rob.
Mods to 1.11.2 to support this:
In index.php
within function readTemplate() {
after
Code Auswählen
global $CAT_REQUEST;
addCode Auswählen
global $PAGE_REQUEST;
after
Code Auswählen
$HTML = preg_replace('/{LAYOUT_DIR}/', $LAYOUT_DIR, $HTML);
addCode Auswählen
$restp = "?cat=" . $CAT_REQUEST . "&page=" . $PAGE_REQUEST;
$HTML = preg_replace('/{CANONICAL_LINK}/', $_SERVER['PHP_SELF'] . $restp, $HTML);
If you use custom parameters in the URL, as I do, and need to include these, you can add something like this between those two lines:
Code Auswählen
foreach ($_GET as $key => $value) {
if (stripos("zoom|goto", $key) !== FALSE) {
$restp .= "&" . $key . "=" . $value;
}
}
where zoom|goto is a list of tags that also need to be included. Or, just specify them all with suitable defaults if they are not already defined - it depends what you are up to!You will also need to adjust your template.html file for whatever layouts you use. Just add
Code Auswählen
<link rel="canonical" href="{CANONICAL_LINK}" />
in the header, under any other <link> tags in there.This ensures that your pages only appear once in Google search results, and all popularity scores etc are amalgamated across the various forms that the url can take, e.g.:
http://www.example.com/
http://www.example.com/index.php
http://www.example.com/index.php?cat=10_Hello
http://www.example.com/index.php?cat=10 ... 10_Welcome
are all treated as the same page.
HTH.
Rob.