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

XF 1.1 Complex redirect from vB4.2 with vBSEO help needed please.

Discussion in 'Installation, Upgrade, and Import Support' started by natpres, Jun 10, 2013.

  1. natpres

    natpres Member

  2. Liam W

    Liam W Well-Known Member

    You should follow the vBSEO instructions to rewrite the old vBSEO URL's to the default vBulletin URL's, and then use a redirection script to redirect the default vBulletin URL's to the new xenForo URL's.
  3. natpres

    natpres Member

    I tried getting the .htaccess from VBSEO and tried that to no avail, I need help putting the two things together please.

    VBSEO to VB
    VB to xenforo
    xenforo to new domain
  4. Ingenious

    Ingenious Well-Known Member

    I did it this way:

    First, I cloned my old vB forum onto a folder on the new domain (this is because Xenforo, at least at the time, had no options to redirect vB pages to equivalent XF pages on a different host). This was just a case of copying the vB files and the database and sticking it in a folder on the new domain.

    Then, turned vBSEO off on the old forum, redirecting it via .htaccess to the normal vB pages but on the cloned forum on the new domain (as the .htaccess vBSEO -> vB part allowed the jump from one domain to another). Example in .htaccess in the original vB forum folder:

    RewriteEngine On
    RewriteRule [^/]+/([\d]+)-.+-([\d]+).html [URL]http://www.newdomain/tempforum/showthread.php?t=$1&page=$2[/URL] [NC,L]
    RewriteRule [^/]+/([\d]+)-.+.html [URL]http://www.newdomain/tempforum/showthread.php?t=$1[/URL] [NC,L]
    You need to adjust depending on what mode you had vBSEO running in.

    Then, XF redirect scripts were stuck in /tempforum/ to redirect vB pages to the equivalent new Xenforo ones in the root folder (where XF lives).

    Hopefully you can tweak this to suit your exact situation.

    So to summarise:

    1. Redirect vBSEO URLs to normal vB URLs but on the new domain (ie. a clone of the original forum, just set up for this redirect)
    2. XF scripts then direct this to the main XF forum.

    Edit - I should add that in my case in addition to a different domain the new forum was also located on a different physical server.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The redirect scripts aren't needed since the ids are the same.

    Put this in your .htaccess file in the web root:

    RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html$ /threads/$1/ [R=301,L]
    It should go immediately after:

    RewriteEngine On
  6. natpres

    natpres Member

    So how do I send it to www. rather then back to railways.

    Unless ive got confused?
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can specify the full URL for the target:

    RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html$ http://www.yoursite.com/threads/$1/ [R=301,L]
  8. natpres

    natpres Member

    So I have the initial VBSEO to VB script

    RewriteEngine on
    RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]

    and I have
    RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html$ http://www.yoursite.com/threads/$1/ [R=301,L]
    Underneath it?
  9. natpres

    natpres Member

    Thank you so much, that single line of code worked perfectly.

Share This Page