WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 301 Redirect for Permalinks? (5 posts)

  1. Thea
    Member
    Posted 10 months ago #

    I've just had to change my permalinks because I've upgraded to a proper directory theme, instead of a half-baked DIY directory.

    Permalinks used to be "bellydanceoz.com/%year%/%month%/%postname/"

    Now I've chosen "bellydanceoz.com/%postname%/" but the Listings are custom posts so they have a base URL ("profile"). Therefore in practice, the new permalink structure is "bellydanceoz.com/profile/%postname%/".

    Is there something I can put in my .htaccess file to redirect one to the other? The postnames haven't changed.

    I've tried using a couple of the Permalink redirect plugins but they're not doing the job reliably. Besides, none of them builds a list of redirects - they just do it "on the fly", which means reliability is never going to improve. I'd be happy if I could find a plugin that built the list of redirects, then I could go in and tweak the few that didn't quite work.

  2. Tara
    Member
    Posted 10 months ago #

  3. Thea
    Member
    Posted 10 months ago #

    Thanks - unfortunately neither of these plugins is being supported any more. The second one looks as though it would be perfect, but it doesn't work because there's no way to tell it to include the base URL.

  4. Thea
    Member
    Posted 10 months ago #

    Update - I just found exactly what I was looking for. Should've thought to check Yoast's blog first!!!

    http://yoast.com/change-wordpress-permalink-structure/

    So simple, worked like a charm.

  5. Thea
    Member
    Posted 10 months ago #

    Eek, no it didn't because the redirect is in my main domain, and if I put it in the htaccess for that domain, it's applying to all my sub-domains as well.

    This is the code I'm using. I don't mind if it applies to all sub-domains, provided it redirects within the sub-domain (so, e.g. the redirect goes to "dressforflamenco.com" within dressforflamenco.com etc).

    Anyone know how to change it so the domain name is a wildcard?

    RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(.*)$ http://bellydanceoz.com/$3

Reply

You must log in to post.

About this Topic