Advertisement:

Author Topic: Anti-SID canonical tag - without PHPSESSID param  (Read 17597 times)

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Anti-SID canonical tag - without PHPSESSID param
« on: March 04, 2012, 02:50:34 PM »
Link to Mod

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/
Support http://MaestroSite.ru/
E-mail smf@maestrosite.ru

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

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

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

Этот мод доступен по лицензии Creative Commons Attribution-ShareAlike (Атрибуция — С сохранением условий) 3.0 Непортированная.
« Last Edit: March 05, 2012, 06:57:33 AM by maestrosite.ru »
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Offline Rust

  • Jr. Member
  • **
  • Posts: 106
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #1 on: March 14, 2012, 07:40:49 PM »
How do you set the canonical tag once its been installed?  Thanks.

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #2 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']
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Offline shubha

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #3 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.

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #4 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?
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Offline shubha

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #5 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


Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #6 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.
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #7 on: July 10, 2012, 02:38:53 AM »
Small bugfix BoardIndex url for SMF 2.0.x with "queryless_url" mode
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Offline mrintech

  • Full Member
  • ***
  • Posts: 413
  • Gender: Male
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #8 on: August 01, 2012, 05:08:34 AM »
Thanks a ton for this MOD :)

Very useful :)

Offline hellboy78

  • Jr. Member
  • **
  • Posts: 270
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #9 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

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #10 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
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #11 on: August 28, 2012, 06:57:35 AM »
v0.6 - Create canonical url for "action=calendar" pages
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Offline sneakers

  • Semi-Newbie
  • *
  • Posts: 62
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #12 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,

Offline maestrosite.ru

  • Semi-Newbie
  • *
  • Posts: 89
    • Сопровождение и модификация форумов SMF
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #13 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.
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #14 on: October 25, 2013, 11:39:03 AM »
This mod is no longer required as of 2.0.6.
No good deed goes unpunished
All helpful urges should be circumvented

Offline daavidfischer

  • Newbie
  • *
  • Posts: 1
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #15 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.








_______________________________

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Anti-SID canonical tag - without PHPSESSID param
« Reply #16 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.
No good deed goes unpunished
All helpful urges should be circumvented