1 mgsolipa Mar 18, 2014 07:07
3 mgsolipa Mar 18, 2014 09:31
Also, it might to be a good idea to add 301 redirections instead of canonical links, specially if you are thinking on SEO, the search engines appear to prefer this technique.
More information about post redirections could be found here: http://b2evolution.net/man/back-office-reference/managing-content/visibility-statuses/visibility-status
4 cipher0 Mar 21, 2014 07:57
Wow, brother! You are something else!
Although I haven't implemented your solution yet, it seems to be just what I've been looking for. I have content on non-b2evolution sites that I would like to post on b2evolution, so 301 isn't really something I can use. This canonical solution should do the trick!
Thanks, man, you are awesome!
[Sorry for asking a question on the manual page, I thought that was what the comment section was for. I know better now.]
5 mgsolipa Mar 21, 2014 10:31
Don't worry @cipher0, your post was fine there in the manual page, but here we could have a more organized discussion, specially knowing that I was about to share some code.
Actually, b2evolution manages both, canonical links and 301 redirect, automatically when it detects that the URL of the post is not as it's supposed to be. But, in the situation you described, having external pages, it looks like you need to specifically push that custom <link>
tags into each post page, so the hack will do the work for you. Just remember that you should manually maintain all the links you have added to your posts.
Regards!
Here is a work around that may help you.
1. Go to the file
/blogs/inc/skins/_skin.funcs.php
and look for the functionskin_description_tag
.2. Find this instruction:
$r = $Item->get_metadesc();
, it should be around the line 930.3. Paste this code right below the mentioned instruction:
Now, you can type the canonical url in the field <meta> desc:. Remember to wrap it by two open and close square brackets, like this:
[[http://example.com]]
. The following tag will be included into the<head>
section of the html code at your post:Regards!