2 fplanque Sep 10, 2011 21:52

is this really a good idea to add more slugs to a single post ?
I mean is it really effective seo-wise ?
Sorry to resurrect this old thread but my question relates directly to the subject matter and I figured keeping it all together makes things easier to find.
Does the automatic 301 redirect still work in b2evo 5.x ? I've just upgraded from a very old installation to the current latest (5.0.8). My old installation had Post Titles with "spaces" but URLs/slugs in the format domain.com/slugname/year/month/day/this_is_the_title_of_the_post
Nowadays, underscores are undesirable in regards to SEO, and I'd like to find some way to rename all my posts to use hyphens (-) in place of underscores (_). At the same time, I'd like to redirect all those old posts to the new posts. Is there an easy, system-wide method to globally replace the underscore with a hyphen in the URL/slug of all my old posts, and at the same time auto-301 the old post to the new?
EDIT: If there is no automated way to do this, I would still like to know how to do it manually, since I do need to rename the URLs to use hyphens instead of underscores. Do I just need to edit the post and rename the URL from post_title to post-title and the 301 is automatically created internally? Or is there more to it?
jj.
@jibberjab In cases like yours, the 301 redirect is automatically created from any "extra" slug to the main slug of the item. In your case, if you change the main slug from "the_items_slug" to "the-items-slug", then for further request to "the_items_slug", b2evolution will return "the-items-slug" by default. All slugs associated to each item must be keeped, just add the new ones by directly typing them in the first position of the URL slugs: at the item's expert edition form (please see replacing_main_slug.png). Also, consider that this process requires that the Make canonical parameters should be enabled in the "Single Post Pages" fieldset at http://b2evolution.net/man/single-post-pages-seo.
I'm afraid that there are no tools to accomplish this automatically, it should be done with a directly database manipulation. I'll try to share a simple script but I'm not able to do it right now, so if you can do it by yourself, please let us know.
Thanks.
Just to clarify my latest comment. When I said "main slug", I referred to the "canonical url" of the item.
@mgsolipa
Thanks for that info. Also, it seems the "Redirected (301)" selector is for redirecting outside of b2evo, right?
Yes, when you go to a post with "Redirected" status, you will be sent to the Link to url: set in that item (http://b2evolution.net/man/post-contents-fieldset), no matter if that URL is inside or outside of your b2evo instance.
@jibberjab
I'm afraid that there are no tools to accomplish this automatically, it should be done with a directly database manipulation. I'll try to share a simple script but I'm not able to do it right now, so if you can do it by yourself, please let us know.
If you can share that script it would be appreciated. I know what needs to be done, in concept, but am not comfortable enough with SQL to make the changes. I presume it's a duplication of the post title, separated with a comma, and then a regex replacement of underscore with hyphen on content before the comma...
jj.
Coming back to this from last year, can you post that script you mentioned?
^bump
@jibberjab how many such posts do you actually have?
Nearly 1600 posts across 2 blog sites...
@jibberjab I couldn't find a safe+quick solution at that moment, so I paused indefinitely :(
Maybe I, or maybe somebody else in the dev team, could give it a second chance.
Regards!
b2evo 4 handles multiple URLs for each post.
It will automatically 301 redirect to the latest version of the URL.
(And just in case anyone wonders: 301 is even better than canonical)