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

XF 1.2 vB4 to Xenforo Redirect

Discussion in 'XenForo Questions and Support' started by Carla Birch, Aug 3, 2013.

  1. Carla Birch

    Carla Birch Well-Known Member

    Need a bit of help setting up the redirect of vb4 to Xenforo, i used to have this working but now google webmaster tools is showing a lot of errors, I'm guessing at some stage i edited something and broke it doh.

    Both the normal vb4 and vbseo url are showing up in the google tools

    Old vb4 URL: http://www.yourpshome.net/showthread.php?t=3316
    Old vbSEO URL: http://www.yourpshome.net/f8/your-game-merch-collections-3316/
    New Xenforo URL: http://www.yourpshome.net/threads/your-game-merch-collections.3316/

    I still have my archived_import_log table also and i see the data for that above eg there still.

    my htaccess is:
    #    Mod_security can interfere with uploading of content such as attachments. If you
    #    cannot attach files, remove the "#" from the lines below.
    #<IfModule mod_security.c>
    #    SecFilterEngine Off
    #    SecFilterScanPOST Off
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 500 default
    RewriteEngine on
    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]
        <IfModule mod_rewrite.c>
            RewriteEngine On
            #    If you are having problems with the rewrite rules, remove the "#" from the
            #    line that begins "RewriteBase" below. You will also have to change the path
            #    of the rewrite to reflect the path to your XenForo installation.
            # RewriteBase /
            #    This line may be needed to enable WebDAV editing with PHP as a CGI.
            #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
            RewriteCond %{REQUEST_FILENAME} -f [OR]
            RewriteCond %{REQUEST_FILENAME} -l [OR]
            RewriteCond %{REQUEST_FILENAME} -d
            RewriteRule ^.*$ - [NC,L]
            RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml) - [NC,L]
            RewriteRule (robots\.txt)$ robots.php [NC,L]
            RewriteRule ^.*$ index.php [NC,L]
    my 301config.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 = '/home/username/www/forums';

    /* ----------------------------------------------------------- *\
    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');

    \* ----------------------------------------------------------- */

    My server is now using nginx btw also. Any help is more than welcome.
  2. Carla Birch

    Carla Birch Well-Known Member

  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It all looks correct to me... for an Apache server.

    nginx != htaccess

    For nginx the rewrites must be converted and added to your server config.
  4. Carla Birch

    Carla Birch Well-Known Member

    Any ideas on how to do that jake? I thinked if htaccess did now work then Xenforo Full Friendly URLs would not work, yet they working :s
  5. Carla Birch

    Carla Birch Well-Known Member

    Doh, i feel a fool now the showthread.php file was missing.
    The htaccess works fine.
  6. Carla Birch

    Carla Birch Well-Known Member

  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You already have the correct rule for that:

    RewriteRule f[\d]+/.+-([\d]+)/ showthread.php?t=$1 [NC,L]
    Or I find sometimes it's necessary to specify the range and not use \d:

    RewriteRule f[0-9]+/.+-([0-9]+)/ showthread.php?t=$1 [NC,L]
    And maybe specify the full web path for the target:

    RewriteRule f[0-9]+/.+-([0-9]+)/ /showthread.php?t=$1 [NC,L]
    Or just skip the redirect scripts since the ids are the same:

    RewriteRule f[0-9]+/.+-([0-9]+)/ /threads/$1/ [R=301,L]
    Carla Birch likes this.
  8. Carla Birch

    Carla Birch Well-Known Member

    Many thanks @Jake Bunce one of them other ones got it working, not sure why the one i had did not work but never mind all works now so many thanks :)

Share This Page