Paul.J.Murphy wrote:A suggestion for a simple enhancement to improve crawler/bot friendliness, based on:
http://googlewebmastercentral.blogspot. ... nical.html
Add just after the <title>...</title> in styles/prosilver/template/overall_header.html:Add to assign_vars() in index.php:Code: Select all
<!-- IF U_CANONICAL --><link rel="canonical" href="{U_CANONICAL}" /><!-- ENDIF -->
Add to assign_vars() in viewforum.php:Code: Select all
'U_CANONICAL' => "{$phpbb_root_path}index.$phpEx",
Add to assign_vars() in viewtopic.php:Code: Select all
'U_CANONICAL' => "{$phpbb_root_path}viewforum.$phpEx?f=$forum_id" . (($start) ? "&start=$start" : ''),
I'd also suggest changing the construction of U_VIEW_FORUM and U_VIEW_TOPIC to similarly only include non-zero start parameters, i.e.:Code: Select all
'U_CANONICAL' => "{$phpbb_root_path}viewtopic.$phpEx?" . (($topic_data['topic_type'] == POST_GLOBAL) ? '' : "f=$forum_id&") . "t=$topic_id" . (($start) ? "&start=$start" : ''),
Code: Select all
(($start) ? "&start=$start" : ''))
This should help to eliminate duplicates in search results, improve bot efficiency, and generally have no downsides that I can see. It should have zero impact on board users.
Edit 29 Oct: Updated viewtopic URL to exclude forum_id for globals.
I'm sorry for the blurb here, it comes from area51.phpbb but I received no response as it's not for support purposes. But I had a question regarding this code.
I currently have google indexing my site in two ways. Using my host url: mysite.hosturl.com, and my url: mysite.com
I was wondering if the {$phpbb_root_path} part of this code, could be set as mysite.com. So that when the bots are indexing it as mysite.hosturl.com, the meta tag would encourage it to come in on mysite.com instead of using the hosts domain.
I've been looking for something to do this for awhile (as due to server limitations I can't do a proper 301 redirect)... and this might just be perfect.
So for instance, would it be ok to instead of using
Code: Select all
'U_CANONICAL' => "{$phpbb_root_path}index.$phpEx",
Code: Select all
'U_CANONICAL' => "http://mysite.com/index.$phpEx",
Thanks for the help
