Code: Select all
<link rel="canonical" href="http://www.example.com/" />
Code: Select all
<link rel="canonical" href="http://www.example.com/viewforum.php?f=X" />
Code: Select all
<link rel="canonical" href="http://www.example.com/viewtopic.php?f=X&t=Y" />
Code: Select all
<link rel="canonical" href="http://www.example.com/viewtopic.php?t=Y" />
Code: Select all
http://www.example.com/viewtopic.php?t=X
Code: Select all
'U_CANONICAL' => generate_board_url() . "/viewtopic.$phpEx?" . (($topic_data['topic_type'] == POST_GLOBAL) ? '' : "f=$forum_id&") . "t=$topic_id" . (($start) ? "&start=$start" : ''),
Code: Select all
''
Code: Select all
"f=Y&"
Code: Select all
$template->assign_vars(array(
Thanks!soumik wrote:You can add it after any of the results. The effect will be the same.
Code: Select all
"f=$forum_id&") removed amp; so it became "f=$forum_id&")
Code: Select all
"&start=$start" : '') removed amp; so it became "&start=$start" : '')
The "f=1" query string is for the board to track the forum the user is visiting. This mod generates canonical URL in the format "viewtopic.php?f=1&t=1". Only in case of global threads, it generates canonical URLs in the form "viewtopic.php?t=1", because global threads are present in every forum and it will be a duplicate indexing issue.alahamdan wrote:Hello and thanks for the Mod
I think its a very important one, but i have a question
For some reason when i search for a topic title in Google, i find that Google index my phpbb forum topics as following:
viewtopic.php?f=1&t=36308
While i noticed your using this format as canonical:
viewtopic.php?t=35035
So if Google preferred this way, why don't we use it in this mode?! or it wont make a big difference?
thanks for your reply.soumik wrote:The "f=1" query string is for the board to track the forum the user is visiting. This mod generates canonical URL in the format "viewtopic.php?f=1&t=1". Only in case of global threads, it generates canonical URLs in the form "viewtopic.php?t=1", because global threads are present in every forum and it will be a duplicate indexing issue.alahamdan wrote:Hello and thanks for the Mod
I think its a very important one, but i have a question
For some reason when i search for a topic title in Google, i find that Google index my phpbb forum topics as following:
viewtopic.php?f=1&t=36308
While i noticed your using this format as canonical:
viewtopic.php?t=35035
So if Google preferred this way, why don't we use it in this mode?! or it wont make a big difference?
There is even the option of making the canonical URLs of global threads belong to a particular forum.
About the & issue :
'&' is the HTML code for '&'. '&' will get parsed to '&' when read by the browser. The 'amp;' part is not extra. If you have doubts, please see the source code for any page and view the URLs that contain '&'.