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

XF 1.2 Help needed with rewrites from vBSEO

Discussion in 'Installation, Upgrade, and Import Support' started by darren, Jul 14, 2013.

  1. darren

    darren Member

    Hi Guys,

    Firstly please excuse me I am incredibly rusty on forum admin side of things as I have had health issues for the past year so whatever I learnt from a few years of running a vB site is a little rusty right now :)

    Basically I want to convert my vB4.1.x & vBSEO site over to xF. The problem I am having is I'm not really knowledgeable when it comes to SEO so I need a helping hand.

    What I've done so far:
    1. created a new SQL DB and have installed a fresh XF 1.2 B5 install as a test.
    2. imported my old vB test forum into the new XF system/db and all running without a hitch.
    I've just spent an hour on this site searching various threads regarding rewrites from vBSEO to xF so I don't lose google hits/etc and I've confused myself silly with old posts vs newer methods ETC.

    Could someone please tell me in as black and white fashion as possible what I need to do as xF is completely new to me right now so please bare that in mind.

    My forum URLS vis vBSEO are set to: 001 - Hierarchic .html type URLs with content relevant forums and threads (Default Settings)

    Original VBSEO/VB URL:
    http://www.domain.name/vbtest/general-discussion/441-wonder-if-will-work.html#post498

    Current xF url:
    http://www.domain.name/XFTEST/index.php?threads/wonder-if-this-will-work.441/#post-498

    Any help and guidance would be really magnificent, Thanks so much! :)
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    darren likes this.
  3. darren

    darren Member

    Hi mate and thanks for the quick response.

    Yep I found that url and created the rewrites but then got EXTREMELY confused as I couldn't find showthread etc in the XF directory and also the link provided to kiers rewrites are for vB3 and not for vb4+vbseo so hence my major confusion!

    Treat me like a complete noob when it comes to vBSEO as it was always like a unicorn to me, a mystical beast I installed and never touched :) so any further help would be fantastic.
     
  4. JoseFebus

    JoseFebus Member

    Hi all!

    I just implemented the steps, but my links are redirecting to the home page.

    Is this an old VB link
    Code:
    http://www.tumaternidad.com/consejos-familiares/74-mi-bebe-puja-mucho.html
    This is what the rewrite in .htaccess creates
    Code:
    http://www.tumaternidad.com/showthread.php?t=74
    and this is the correct link in xenFORO
    Code:
    http://www.tumaternidad.com/threads/mi-bebe-puja-mucho.74/
    My VB forum was placed on the root so I placed Kier: Redirection Scripts for vBulletin 3.x. in the root ( no vb folder)

    this is my .htaccess
    Code:
    RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
    Any idea what I am missing?
     
  5. JoseFebus

    JoseFebus Member

    OOPS! I read that the xf_import_log needs to have data... I restored it and now it's working!
     
  6. Jeremy

    Jeremy XenForo Moderator Staff Member

    You need this:
    http://xenforo.com/community/threads/redirection-scripts-for-vbulletin-3-x.5030/

    And the import log if you didn't opt to keep the same IDs.
     
    darren likes this.
  7. darren

    darren Member

    Thanks, I've read with interested but my old url is now defaulting the the default XF forumdisplay it does NOT jump the the thread/post/

    This is what I've done.

    1. copied Kier's files and edited the 301display with the full url to my xF testforum
    2. generated the vBSEO settings and created a .htaccess file within my old vBTEST directory (where kiers files are stored)
    .htaccess looks like this (no further content in the file)

    Code:
    RewriteEngine on
    RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
    But as I've said when I goto the old vbtest thread it now jumps me to the forumdisplay on XF and does not display the thread/post.

    I'm not sure what is meant by the import.log as I ticked the option when doing the VB->XF conversation as suggested so I don't think I need that?

    Where would I find the xf_import_log if i were to try and add this to see if changes anything?
     
    Last edited: Jul 14, 2013
  8. Jeremy

    Jeremy XenForo Moderator Staff Member

    You had the option to store the Import Log as the last step of your import process. I believe it asked you for a table name, but you should be able to find it by inspecting the tables in your database.
     
    darren likes this.
  9. darren

    darren Member

    Still not working @King Kovifor :(

    The log was called xf_import_log so changed the filename in 301 but still defaulting back to the forumdisplay and not the thread :

    Code:
    <?php
    
    /* ----------------------------------------------------------- *\
    This variable defines where XenForo is installed.
    If you have not installed XenForo into the same directory in which
    vBulletin was installed, you will need to provide the full path to
    the XenForo directory here. Remove the leading // and then enter
    the path as in the following examples:
    //    $fileDir = '/home/example/public_html/new_forums';
    //    $fileDir = 'C:/inetpub/wwwroot/xenforo';
    \* ----------------------------------------------------------- */
        $fileDir = '/var/www/vhosts/mysite.com/httpdocs/XFTEST';
    /* ----------------------------------------------------------- *\
    This constant defines the table from which the import redirection
    scripts will fetch their data. Normally they will use the table
    'xf_import_log', but if you have archived your import data, you
    should provide the name of the archive table here. Remove the
    leading // and then replace 'import_log_x' with the name of your
    archive table, as in the following examples:
        define('IMPORT_LOG_TABLE', 'my_import_log');
        define('IMPORT_LOG_TABLE', 'import_log_my_forums');
    \* ----------------------------------------------------------- */
        define('IMPORT_LOG_TABLE', 'xf_import_log');
     
  10. Jeremy

    Jeremy XenForo Moderator Staff Member

    Unfortunately, I am not very good at URL rewrites. Any further support may put you in a worse state, so I shall bow out and let more knowledgeable users help you solve this.
     
    darren likes this.
  11. darren

    darren Member

    Well upon inspection for anyone else who may try and help I've looked at the table on xf_import_log and it's empty but i also have a table called 'archived_import_log' which has content so I've changed the 301 to that and still the same problem.. :(


    HELP please!! :(
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The import log is not necessary in your case since the ids are the same.

    Add these rules to the top of the .htaccess file in your /vbtest directory:

    Code:
    RewriteEngine On
    
    RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html /XFTEST/index.php?threads/$1/ [R=301,L]
    
    That's it.
     
    darren likes this.
  13. darren

    darren Member

    @Jake Bunce Thank you for your input I have found something quite strange going on.

    I got it working with or without your addition on Firefox and Chrome but using IE10 it defaults to the forumdisplay and not the thread/post with or without your addition.

    Any ideas?
     
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    When you click on an old thread link? Can you provide the link so I can test it?
     
    darren likes this.
  15. darren

    darren Member

    Code:
    http://www.myspain.es/vbtest/general-discussion/441-wonder-if-will-work.html#post498
    As I said, working fine in FF and Chrome but in IE10 it defaults to list of forums (formdisplay)

    Thanks for any input.
     
  16. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It works for me. I don't know why IE10 isn't working for you.
     
  17. darren

    darren Member

    Thank you @Jake Bunce for confirming that for me. I'll have a look on another laptop running IE10 to see what's going on so just to confirm this is my htaccess file is this all ok? it seems to work! :)

    Code:
    RewriteEngine on
    
    RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html /XFTEST/index.php?threads/$1/ [R=301,L]
    RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
    
    Can't wait for xF1.2 to go gold so I can move the live site over now I'm not scared to death of replacing vBSEO urls :)

    Thanks so much for your help mate!
     
    Last edited: Jul 15, 2013
  18. darren

    darren Member

    Hi guys and perhaps @Jake Bunce could further help.

    I've just gone live with my site and rewrites seem to be working just great but upon logging into the admin panel I'm getting lots of errors regarding the old vb archive.

    For example of one:

    Code:
    Error Info
    ErrorException: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Compilation failed: unrecognized character after (?&lt; at offset 27 - /var/www/vhosts/domain.com/httpdocs/forum/archive/index.php:19
    Generated By: Unknown Account, Today at 8:18 PM
    Stack Trace
    
    #0 [internal function]: XenForo_Application::handlePhpError('#/archive/index...', '/forum/archive/...', NULL)
    #1 /var/www/vhosts/domain.com/httpdocs/forum/archive/index.php(19): preg_match()
    #2 {main}
    
    Request State
    
    array(3) {
      ["url"] => string(61) "http://www.domain.com/forum/archive/index.php/f-33-p-301.html"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(0) {
      }
    }
    
    Obviously search engines have made good use of my old vB archive so I'm eager to get this working if possible?

    Thank you.
     
  19. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

Share This Page