Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: maestrosite.ru on March 04, 2012, 02:50:34 PM

Title: Anti-SID canonical tag - without PHPSESSID param
Post by: maestrosite.ru on March 04, 2012, 02:50:34 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3315)

Add canonical tag for main page, boards and topics pages without SID (PHPSESSID) param.
For SMF 2.0.x also lock default canonical tag.

Demo http://sibsp.MaestroSite.ru/forum/ (http://sibsp.maestrosite.ru/forum/)
Support http://MaestroSite.ru/ (http://maestrosite.ru/)
E-mail smf@maestrosite.ru

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License (http://creativecommons.org/licenses/by-sa/3.0/).

Вывод тега "canonical" для главной страницы, страниц разделов и тем, строго без сессисоной переменной (даже для первой загрузки страницы)

Пример работы мода http://sibsp.MaestroSite.ru/forum/ (http://sibsp.maestrosite.ru/forum/)
Сопровождение http://MaestroSite.ru/ (http://maestrosite.ru/)
E-mail smf@maestrosite.ru

Этот мод доступен по лицензии Creative Commons Attribution-ShareAlike (Атрибуция — С сохранением условий) 3.0 Непортированная (http://creativecommons.org/licenses/by-sa/3.0/).
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: Rust on March 14, 2012, 07:40:49 PM
How do you set the canonical tag once its been installed?  Thanks.
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: maestrosite.ru on March 16, 2012, 03:58:37 AM
How do you set the canonical tag once its been installed?  Thanks.

Good day!
For smf2.x this mod use native variable $context['canonical_url'].
For smf1.x - create url by variables ['current_topic'] ,  ['current_board']  and  ['current_action']
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: shubha on April 25, 2012, 07:48:48 AM
It will count the PHPSESSID in seo software or not. Normally in my website , no PHPSESSID shows at the top as well not in search engine. But in SEO software its.
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: maestrosite.ru on April 25, 2012, 10:21:28 AM
It will count the PHPSESSID in seo software or not. Normally in my website , no PHPSESSID shows at the top as well not in search engine. But in SEO software its.

You can remove session (auth) cookies for your forum, or use guest session in your browser, and load any topic (your forum). For first loaded page you can see
that internal links contains PHPSESSID. Tag "canonical" also contains session value.

For example, by direct link to your message:
Code: [Select]
$ curl -A 'Mozilla/5.0' http://www.simplemachines.org/community/index.php?topic=470299.msg3321726#msg3321726 | grep '"canonical"'note: this site rename "PHPSESSID" to "P"

PS can I see your forum url?
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: shubha on April 25, 2012, 02:44:58 PM
Did not work the above code. Can you please follow the robots.txt than

Disallow:/?PHPSESSID

I have read the simpemachines.ru ,but i forgot that url while translate. Some robots.txt

Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: maestrosite.ru on April 25, 2012, 11:56:44 PM
Sorry, I do not understand you.

Step by step, SMF2 default config without mods (ex == for example):
1. If user agent don't send session cookie, internal links on received page contains session param.
Session cookie and session param names by default is PHPSESSID
ex: requested page from sitemap, or by external page - http://www.simplemachines.org/community/index.php?topic=470299.0

2. Meta-tag rel="canonical" (if present on a page) also contains session param
ex:
Code: [Select]
<link rel="canonical" href="http://www.simplemachines.org/community/index.php?P=cf91a244cd05cf05c92009be72760d95&amp;topic=470299.0" />
3. Thus, we obtain two different addresses.

4. If we clean up the cookies and repeat steps, we obtain a new canonical address for the same page
ex:
Code: [Select]
<link rel="canonical" href="http://www.simplemachines.org/community/index.php?P=78ea941eb4195ca54bf601a21a348553&amp;topic=470299.0" />

You can see this situation in real browser or in serverside software (API, gateways, agregators, etc...)


PS can I see your forum url? Or examples links with "Did not work the above code." Сan be a private message.
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: maestrosite.ru on July 10, 2012, 02:38:53 AM
Small bugfix BoardIndex url for SMF 2.0.x with "queryless_url" mode
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: mrintech on August 01, 2012, 05:08:34 AM
Thanks a ton for this MOD :)

Very useful :)
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: hellboy78 on August 02, 2012, 01:56:38 PM
I use SMF 1.1.16

which version of of anti-sid I have to install?
0.2  or 0.5  ?????

thanks
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: maestrosite.ru on August 03, 2012, 09:54:42 AM
I use SMF 1.1.16

which version of of anti-sid I have to install?
0.2  or 0.5  ?????

thanks
Good day!

If you use portal or guest can view user profies, then install 0.5. Otherwise enough 0.2
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: maestrosite.ru on August 28, 2012, 06:57:35 AM
v0.6 - Create canonical url for "action=calendar" pages
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: sneakers on November 30, 2012, 08:19:48 PM
Hello,
I have problem with the mod . When I try to install the mod, suddenly logged out me with account on forum (smf 2.0.2). Do you know how to solve this problem? I also try to manual installation, but the problem still occurs.

Thanks,
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: maestrosite.ru on November 30, 2012, 11:11:36 PM
Good day!
When I try to install the mod, suddenly logged out me with account on forum (smf 2.0.2).

How I can reproduce problem? Please, write you actions step-by-step.
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: Arantor on October 25, 2013, 11:39:03 AM
This mod is no longer required as of 2.0.6.
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: daavidfischer on October 30, 2013, 03:22:39 AM
So are you saying that we can see the canonical tag from the list? I was little confused here. Can you explain well how the canonical tag can be added? If you can explain it in detail that would be really helpful for my project.








_______________________________
Title: Re: Anti-SID canonical tag - without PHPSESSID param
Post by: Arantor on October 30, 2013, 02:05:08 PM
Um, no.

2.0 has always had the canonical tag inside the source but prior to 2.0.6 it is buggy. This mod fixes the bug, SMF 2.0.6 fixes the bug in a different way.