Learn about Centmin Mod LEMP Stack today
Become a Member

Xenforo XenForo Redirects for vBulletin 1.0.2

Discussion in 'Forum software usage' started by Itworx4me, Feb 5, 2018.

  1. Itworx4me

    Itworx4me Premium Member Premium Member

    191
    20
    18
    Mar 14, 2017
    Ratings:
    +32
    Local Time:
    11:07 PM
    Nginx 1.17.X
    MariaDB 10.3.X
    Has anyone tested this on centmin yet?

    Thanks,
    Itworx4me
     
  2. Jon Snow

    Jon Snow Active Member

    433
    65
    28
    Jun 30, 2017
    Ratings:
    +103
    Local Time:
    3:07 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Was 1.0.2 a typo? o_O
     
  3. Itworx4me

    Itworx4me Premium Member Premium Member

    191
    20
    18
    Mar 14, 2017
    Ratings:
    +32
    Local Time:
    11:07 PM
    Nginx 1.17.X
    MariaDB 10.3.X
  4. Sunka

    Sunka Well-Known Member

    1,103
    299
    83
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +481
    Local Time:
    8:07 AM
    Nginx 1.15.8
    MariaDB 10.3.12
  5. Jon Snow

    Jon Snow Active Member

    433
    65
    28
    Jun 30, 2017
    Ratings:
    +103
    Local Time:
    3:07 AM
    Nginx 1.13.9
    MariaDB 10.1.31
  6. Rake-GH

    Rake-GH Premium Member Premium Member

    30
    16
    8
    Jul 29, 2019
    USA
    Ratings:
    +22
    Local Time:
    2:07 AM
    default
    default
    Several people on the Xenforo forum are complaining that this addon doesn't work on nginx and haven't got a formal response from Xenforo, they said it's not supported by them.

    The addon in question is for Xenforo 2:
    XenForo Redirects for vBulletin

    The latest version is 1.1.5

    It redirects old vbulletin URLs to Xenforo, but it only works correctly on apache. Has anyone got this working?

    I tried a recommended fix which fixed 95% of redirects but introduced another bug where certain URLs are redirecting to "domain.com/domain.com/"

    Besides this, everything is working perfectly, and other people are complaining of the same issue, so I'm mostly sure that it's not my config. The Xenforo friendly URL rewrites are setup and working correctly per the instructions, so again, that should not be a cause of the issue.

    Here is the important portion of my conf:
    Code:
    location / {
    
        try_files $uri $uri/ /index.php?$uri&$args;
        index index.php index.html;
    
        #auth_basic "Private";
        #auth_basic_user_file /usr/local/nginx/conf/htpasswd;
    
        include /usr/local/nginx/conf/503include-only.conf;
    
        # block common exploits, sql injections etc
        include /usr/local/nginx/conf/block.conf;
    }
    
    location /admin.php {
       auth_basic "Private";
       auth_basic_user_file /usr/local/nginx/conf/htpasswd;
       include /usr/local/nginx/conf/php.conf;
    }
       
    location /install/ {
       auth_basic "Private";
       auth_basic_user_file /usr/local/nginx/conf/htpasswd;
       include /usr/local/nginx/conf/php.conf;
    }  
       
    location /install/data/ {
      internal;
    }
    location /install/templates/ {
      internal;
    }
    location /internal_data/ {
      internal;
    }
    location /library/ { #legacy
      internal;
    }
    location /src/ {
      internal;
    }
    
    location ~ \.php$ {
      #vbulletin redirect partial fix:
      #try_files $uri /index.php?$uri&$args;
     
      #normal:
      #try_files $uri =404;
     
      fastcgi_pass    127.0.0.1:9000;
      fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include         fastcgi_params;
    }
    My post on Xenforo forum is here, for more info:
    XenForo Redirects for vBulletin

    Any help would be appreciated.
     
  7. Rake-GH

    Rake-GH Premium Member Premium Member

    30
    16
    8
    Jul 29, 2019
    USA
    Ratings:
    +22
    Local Time:
    2:07 AM
    default
    default
    Fixed!

    you must have the Xenforo Redirects for vBulletin addon installed, and select your "import_log" table in the addon options.

    In the PHP block:

    you must comment out:
    Code:
    try_files $uri =404;
    replace it with:
    Code:
    try_files $uri /index.php?$uri&$args;
    Then restart nginx and clear your browser cache and maybe any other caches.

    Should that not solve your problem here is a fix for showthread.php, put this above you "location /" block


    Code:
    location ~ ^/showthread.php
    {
        if ($args ~* ^(\d+)-(.+)$)
        {
            set $tid $1;
            set $args '';
            rewrite ^ /threads/$tid permanent;
        }
    
       if ($args ~* ^t=(\d+)$)
        {
        set $tid $1;
        set $args '';
        rewrite ^ /threads/$tid permanent;
        }
    }
    
     
    • Informative Informative x 1