Seamless Permalink Updating

Update: The solution to the problem in this post has been found and posted.

I wish I would have set up the permalink structure here properly months ago when I started blogging. Now I want to change it, but if I am not careful in doing so, I’m effectively losing any external links to my posts, particularly those the search engines have linked to.

What I mean is, I want to go from this:

to this:

without making the first link ineffective.

I know this can be accomplished via mod_rewrite, but I’m by no means savvy enough to figure it out. I’ve experimented, I’ve read all about regular expressions, but I have as of yet been unsuccessful at wrapping my mind around the concepts involved.

I do know that I need to rewrite /number/number/number/text-numbers-hyphens/ to simply /text-numbers-hyphens/.

Seems simple enough, but for all its wonder, mod_rewrite is strange voodoo.

Anyone reading this skilled enough to lend me a hand? I asked on the WordPress support board, but I did so noting that several other users with similar questions haven’t received any real help in ten or more months. Needless to say, I’m not holding my breath either.

11 thoughts on “Seamless Permalink Updating”

  1. I’m probably at the same point as you as far as understanding mod_rewrite. I played with it a couple years ago and ended up messing up all my links and my photo gallery (should have done a test site like you…lesson learned). I’ll let you know if I run across anything that can help you out. It’s strange voodoo indeed…

    Curious…why the change? Speed up the site?

  2. Actually, the change will have a twofold effect:

    1) The URLs will be more attractive to human users — is a lot nicer than Just seems cleaner, perhaps more professional. Though admittedly, that’s quite subjective!

    2) The date of the post adds nothing of value for search engines; removing it will increase the power of whatever is left in the URL, concentrating the power of the keywords present, so to speak. I’m a sucker for SEO tips like that, I suppose. :)

  3. I recently contemplated doing the same thing, but voted against it primarily because I felt the hassle just wasn’t worth the payoff, which, unfortunately, is probably not much. Nonetheless, I am going to look into a “clean” way of doing this via htaccess as soon as possible. If/when I am able to cobble something together, you will be the first (- er, second) to know. ;)

  4. not sure what version (think it was 2.3) my mate had running on his site and he had similar permlinks.

    I was snooping at his backend and found that you could add a custom setting.

    I set it up as /%category/%title and it ended by having url’s as follows:



    A few kinks as you can see by the second url but i hope to iron these out and will experiment later with htaccess but my knowledge is limited but i will let you know if i find the grail.

  5. Donace — Changing the permalinks the system creates is quite easy, yup. The problem I have is that as soon as I change my permalink structure, any links which reference the old style — including those within search engine indexes — will be invalidated. I’m looking / hoping for a way to seamlessly redirect any requests for old style permalinks to the new style, which I hope to implement soon.

  6. Looks like you beat me to the punch! Your permalinks look much cleaner now, I must admit.. How has the htaccess code been working? Any issues? Have you examined your 404 error log since the change? I may just have to rethink my permalink strategy (again) after all..

  7. Jeff_ — Actually, I never checked Apache’s error log until I implemented this change; I’ve been checking it pretty much daily since doing so!

    And so far, everything has been working great. What is a mystery to me is how the permalink to the post » Kingdom Front works; the permalink to it contains two percentage signs, which wouldn’t be caught by the regex I’m using. Yet the permalink seems to work just fine, so I’m not getting worked up about it by any means.

  8. hey rick, there is a small problem i am facing here…
    I use google webmaster… and it still shows me indexed sites from the time when i was just setting up my blog, (i mean i was experimenting from Joomla, wordpress, etc) later, i used wordpress with no permalink updates.. now google webmaster shows me links from the Joomla time, as well as WordPress’s non-seo permalinks… how to delete the Joomla links and how to update those wordpress links to the current ones…
    Please help me…

    Latest from Nikhil Gupta: 1000 Megauploads Links’ List!

  9. Nikhil Gupta: Removing content from Google can be done in a variety of ways, but all of them will take place at Google’s own pace as its crawler discovers that the content is missing or forbidden:

    As far as getting your new content indexed, if Google’s crawler can crawl your site using the new address structure, those addresses will be indexed.

    The addresses your site used prior to the permalink settings were like this, correct?:

    If that’s the case, try visiting that old address; it redirects to the new structure just fine, so Google should see that when it tries browsing your older style addresses and it will update accordingly.

Leave a Comment

Your email address will not be published. Required fields are marked *

Use your Gravatar-enabled email address while commenting to automatically enhance your comment with some of Gravatar's open profile data.

Comments must be made in accordance with the comment policy. This site uses Akismet to reduce spam; learn how your comment data is processed.

You may use Markdown to format your comments; additionally, these HTML tags and attributes may be used: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.

the Rick Beckman archive
Scroll to Top