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

XF 1.1 Swapped Wordpress for XF in Root, need redirect help

Discussion in 'Troubleshooting and Problems' started by AdamU, Jun 24, 2013.

  1. AdamU

    AdamU Member


    I had wordpress in my root directory but have moved it from 3dsbuzz.com to 3dsbuzz.com/archive, and moved my XF installation into the root from 3dsbuzz.com/3ds-forum to 3dsbuzz.com.

    Both are working correctly but I need to get the old URLs to redirect to either the new URLs (from 3dsbuzz.com/post-name/ to 3dsbuzz.com/archive/post-name/) or back to the homepage instead of me just having lots of XF error messages.

    I've been playing around with .htaccess but don't really know what I'm doing.
  2. AdamU

    AdamU Member

    Sorry, I'm still suffering and need to bump this. What does the .htaccess file need to include to redirect dead URLs to the same URL but with "archive/" at the start?
  3. LPH

    LPH Well-Known Member

    @Jake Bunce might be able to help you with the redirects. He probably hasn't seen your request yet.
    Jake Bunce likes this.
  4. SneakyDave

    SneakyDave Well-Known Member

    I think the main issue you have is that both WP and xenForo use index.php to route everything, which makes it hard to create a regexp to figure out what visitors are trying to get to, an xF thread, or a WP article/post.

    How many WP entries, categories, tags do you have? If it's a small number, maybe you can just list individual redirects to that content?

    Edit: sorry, didn't see that you listed your site, I'm taking a look to see if there's something that can be figured out easily.
  5. SneakyDave

    SneakyDave Well-Known Member

    Looks like some of your links on your archives page are still pointing to your original WP installation, like the "See more 3DS updates" button at the bottom, and your link to "Every 3DS Buzz Post Ever" at the top.

    Just an FYI, doesn't help your redirect problem. It would be easier if your forums weren't in the root directory.
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add this to the top of the .htaccess file in the web root:

    RewriteEngine On
    RewriteRule ^(post-name1|post-name2|post-name3)/$ /archive/$1/ [R=301,L]
    You need to manually specify every Wordpress slug that you want to redirect, separated by a pipe (|).
    SneakyDave likes this.
  7. AdamU

    AdamU Member

    Sorry it's taken me nearly a month to respond. Thanks very much Jake. That works well for a a few posts but is there anyway to get it working for all of them? If I use that format for all of my posts, my server can't handle it and just gives 500 errors.
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You might have to duplicate the rule to cover all of the slugs without exceeding limits for a single rule.

Share This Page