1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Most Appropriate Way To Redirect URLs

Discussion in 'Server Configuration and Hosting' started by TheBigK, Mar 26, 2013.

  1. TheBigK

    TheBigK Well-Known Member

    We recently migrated our posts from WordPress to Xenforo and unfortunately, it was impossible to setup redirect for all the posts. I however want to setup redirects for a few posts that are heavily linked and might just give us some of the old link-juice.

    The OLD URL was: http://www.crazyengineers.com/dennis-ritchie-creator-of-c-programming-language-unix-dies-1129/

    After migration, the new location is -

    http://www.crazyengineers.com/threa...or-of-c-programming-language-unix-dies.64573/

    ..and there are several (about ~50) such URLs in this format which I'd like to redirect to their new locations.

    My Questions -

    1. What rule should I add to .htaccess for the redirect?
    2. Is there any other, better way to redirect the URLs?

    Thanks
     
  2. Ketola

    Ketola Member

    You could do a simple
    Code:
    RewriteRule ^dennis-ritchie-creator-of-c-programming-language-unix-dies-1129/$ threads/dennis-ritchie-creator-of-c-programming-language-unix-dies.64573/ [R=301,L]
    for each of the URLs.

    It's laborious, but if there's just a few of the URLs it's probably manageable. You might also want to look at RewriteMap directive if you're looking for a "more elegant" solution.

    The key here is doing 301 Moved Permanently redirects here, because that tells search engines to give all the link juice to the new URL.
     
    TheBigK likes this.

Share This Page