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

XF 1.4 VB4 Redirects not Working - on phones or tablets

Discussion in 'Troubleshooting and Problems' started by Bonsai Coder, Feb 7, 2015.

  1. Bonsai Coder

    Bonsai Coder Active Member

    Fresh install of xenForo and an import of data from vBulletin 4.x into a virgin xenForo database using all the old vBulletin thread ID's.

    Redirects (thread links) in old content was taking me to the old vBulletin install.

    So I added this code to .htaccess in the root:

    Code:
    RewriteEngine On
    
    RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html$ /index.php?threads/$1/ [R=301,L]
    It fixed the problem for desktop access. But I am still having the problem in Android and tablet. Any thoughts?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    If it's working from your PC then it will work for any device - redirects are not device specific.
     
  3. Bonsai Coder

    Bonsai Coder Active Member

    Edit - it turns out it does NOT work on my PC.

    All the links are still going to the old vBulletin install, instead of going to the new xenForo install.
     
    Last edited: Feb 7, 2015
  4. Bonsai Coder

    Bonsai Coder Active Member

    Last edited: Feb 7, 2015
  5. Bonsai Coder

    Bonsai Coder Active Member

    Ok wait a second, let me try to reason this out.

    I left my vBulletin install up at www.bonsainut.com/forums

    I'm assuming the link redirect WON'T work as long as the old site is still up at /forums (?)
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    You should archive that vB install.

    Something like domain.com/_archive/vb
     
  7. Bonsai Coder

    Bonsai Coder Active Member

    Thanks Brogan.

    With the old site now in a _archive folder, I am getting this result from the link:

    Error.
    The requested forum could not be found.

    So the code I added to the .htaccess file is clearly not working.
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

  9. Bonsai Coder

    Bonsai Coder Active Member

    I uploaded the scripts into my root directory.

    I edited the 301config file with my values:

    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 = '/home/bonsainu/public_html';
    
    /* ----------------------------------------------------------- *\
    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', 'archived_import_log');
    Sadly, it is not working...

    Bonsai Nut - Error
    The requested forum could not be found.
     
  10. Mike

    Mike XenForo Developer Staff Member

    You need to place the redirect scripts in the position where they cover the old URLs. Based on what you gave, that would be the forums directory not the root.

    However, doing that might interfere with the forums path that XenForo uses by default. A workaround would be to change the name of that path with route filters. Alternatively, you could use rewrites to implicitly redirect the specific "plain" URLs to the files in the root.
     
  11. Bonsai Coder

    Bonsai Coder Active Member

    Thanks again Brogan and Mike! I recreated the forums directory, moved the scripts there, and everything works fine! I had to disable friendly URL's (because of the /forums conflict), but otherwise the site isn't showing any hiccups.
     
    Last edited: Feb 8, 2015

Share This Page