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

XF 1.4 Please help with URL Redirects

Discussion in 'Installation, Upgrade, and Import Support' started by Amin Sabet, Feb 15, 2015.

  1. Amin Sabet

    Amin Sabet Well-Known Member

    I am doing my first vB4 to XF import. Quite exhilirating!

    These are my current .htaccess contents which contain the rewrites I put in place after uninstalling vBSEO last year:

    ## Forward non-www to www
    RewriteCond %{HTTP_HOST} ^talkemount.com
    RewriteRule (.*) http://www.talkemount.com/$1 [R=301,L]
    ## Forward vBSEO to non-vBSEO URLs after uninstalling vBSEO
    RewriteRule [^/]+/[^/]+-([0-9]+)/ http://www.talkemount.com/showthread.php?t=$1 [L,R=301]
    RewriteRule ^f([0-9]+)/$ http://www.talkemount.com/forumdisplay.php?f=$1 [L,R=301]
    RewriteRule ^members/(.+)/ http://www.talkemount.com/member.php?username=$1 [L,R=301]

    Can someone please tell me how to change these as needed to redirect to my new Xenforo URLs?
  2. Amin Sabet

    Amin Sabet Well-Known Member

    Or do I just upload contents of standard-basic-advanced/upload folder to my forum root as described here?
  3. Amin Sabet

    Amin Sabet Well-Known Member

    I've got my redirects working okay from my old vB URLs to the new XF ones, but the old old vBSEO URLs indexed in Google aren't redirecting to the new XF ones.
  4. Mike

    Mike XenForo Developer Staff Member

  5. Amin Sabet

    Amin Sabet Well-Known Member

    Unfortunately not working for me, but that's okay. Google already 98% switched over from my old vBSEO URLs to my vB4 URLs, and the latter are getting properly redirected to my new XF URLs.
  6. Amin Sabet

    Amin Sabet Well-Known Member

    I'd like to try again at this since Webmaster Tools is reporting a lot of crawl errors.

    The site Mike mentioned gave me the rules below, which I am using in htaccess along with the standard-basic-advanced files posted by Luke here and the 301config.php file with archived import log as mentioned here.

    RewriteRule f[\d]+/.+-([\d]+)/index([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule f[\d]+/.+-([\d]+)/ showthread.php?t=$1 [NC,L]
    RewriteRule f([\d]+)/index([\d]+).html forumdisplay.php?f=$1&page=$2 [NC,L]
    RewriteRule f([\d]+)/ forumdisplay.php?f=$1 [NC,L]
    The great majority of my indexed pages are in this vBulletin format:


    and those are redirecting properly to my current URL:


    but Google still has some indexed in this vBSEO version:


    and those get redirected to the forum without going to the specific thread.

    The odd thing is that some of those vBSEO URLs are being redirected fine. Like this one:


    gets properly redirected to here:


    If I add a trailing slash to this:


    then it works. But others indexed have a trailing slash and don't work. Like this one:


    Any help greatly appreciated.
  7. Mike

    Mike XenForo Developer Staff Member

    You don't have a rule that would match the thread URL without the trailing slash. You're either matching with index#.html or with a trailing slash.

    A modified version of your second rule would probably work:
    RewriteRule f[\d]+/.+-([\d]+)(/|$) showthread.php?t=$1 [NC,L]
    Your last example appears to be a post-specific format, so it won't match any of your existing rules. This may work:

    RewriteRule f[\d]+/.+-post([\d]+)(/|$) showpost.php?p=$1 [NC,L]
  8. Amin Sabet

    Amin Sabet Well-Known Member

    Hi Mike, thanks for supporting with me on this. I added those two rules, and they don't seem to have made any difference. Was I supposed to remove any of the other rules?
  9. Mike

    Mike XenForo Developer Staff Member

    Where did you add them? Rules are processed top down and as soon as one matches, it stops. Because of the URL structure, your last rule ends up being a catch all.

    Note that the first rule I posted was a modification of your second rule so it would replace it. The post rule can probably go first.

    Also, when testing rule changes, be aware of browser caching. You may need to try in an incognito window or a different browser to confirm whether changes have been applied.
  10. Amin Sabet

    Amin Sabet Well-Known Member

    Thank you very much, all those are working!
  11. Amin Sabet

    Amin Sabet Well-Known Member

Share This Page