News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Anti-SID canonical tag - without PHPSESSID param

Started by maestrosite.ru, March 04, 2012, 02:50:34 PM

Previous topic - Next topic

maestrosite.ru

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 [email protected]

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 [email protected]

Этот мод доступен по лицензии Creative Commons Attribution-ShareAlike (Атрибуция — С сохранением условий) 3.0 Непортированная.
First of all, sorry for my english. По-русски у меня получается значительно лучше.

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

You can try other modifications - see demo

Rust

How do you set the canonical tag once its been installed?  Thanks.

maestrosite.ru

Quote from: Rivet on March 14, 2012, 07:40:49 PM
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

shubha

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.


maestrosite.ru

Quote from: 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.

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:
$ 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

shubha

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



maestrosite.ru

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:
<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:
<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

maestrosite.ru

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

mrintech


hellboy78

I use SMF 1.1.16

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

thanks

maestrosite.ru

Quote from: 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
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

maestrosite.ru

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

sneakers

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,

maestrosite.ru

Good day!
Quote from: sneakers on November 30, 2012, 08:19:48 PM
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

Arantor


daavidfischer

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.








_______________________________

Arantor

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.

Advertisement: