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

XF 1.2 Redirect VBSEO to Xenforo (Nginx)

Discussion in 'Installation, Upgrade, and Import Support' started by younes, Jan 2, 2014.

  1. younes

    younes Active Member

    hello guys
    i want redirect my current VBSEO urls to Xenforo
    VBSEO thread example:
    http://www.domain.com/thread145257.html
    VBSEO forums Example:
    http://www.domain.com/forum299.html
    i use this http://tools.geekpoint.net/xfseo/ to convert my VBSEO links
    RewriteRule thread([\d]+)-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule thread([\d]+).html showthread.php?t=$1 [NC,L]
    RewriteRule forum([\d]+)-([\d]+).html forumdisplay.php?f=$1&page=$2 [NC,L]
    RewriteRule forum([\d]+).html forumdisplay.php?f=$1 [NC,L]

    but it's not working :(
    thanks
     
  2. rainmotorsports

    rainmotorsports Well-Known Member

    Going to have to get the rules converted for NGINX as it doesn't support apaches rewrite engine rules. I have seen quite a few people here get help on this though.
     
    younes likes this.
  3. younes

    younes Active Member

    i found something ! :D
    a online converter!
    http://winginx.com/htaccess
    so easy!
    thanks
     
  4. younes

    younes Active Member

    its strange
    i dont know why its not working
    this is my nginx config
    Code:
    server {
    listen *:80;
    server_name www.domain.com;
    rewrite ^/(.*) http://domain.com/$1 permanent;
    }
    server {
    listen *:80;
    server_name domain.com;
    root /home/username/www;
    location / {
    index index.php;
    try_files $uri $uri/ /index.php?$uri&$args;
    rewrite thread([\d]+)-([\d]+).html /showthread.php?t=$1&page=$2 break;  
    rewrite thread([\d]+).html /showthread.php?t=$1 break;   
    rewrite forum([\d]+)-([\d]+).html /forumdisplay.php?f=$1&page=$2 break;   
    rewrite forum([\d]+).html /forumdisplay.php?f=$1 break;
    }
    location /(data|internal_data|library)/ {
    allow 127.0.0.1;
    deny all;
    }
    location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    }
    location ~ /\.ht {
    deny all;
    
    }
    
     
  5. younes

    younes Active Member

    anyone please :D
    i need your help guys
    i can pay for it, send me pm please
    its emergency! :eek:
     
  6. rainmotorsports

    rainmotorsports Well-Known Member

    One thing did you download the files and put them in the directory?
    The redirects from that site require the files even once converted for nginx. Its possible even with them you may still have something wrong. But I figured I would ask the obvious question did you get and put the files where they go.
     
  7. younes

    younes Active Member

    i think that files is for VB3 ( is it working on VB4?)
    i have VB4 + VBSEO
    my htaccess:
     
    Last edited by a moderator: Jan 5, 2014
  8. younes

    younes Active Member

    anyone ? :(
    i lost 250.000+ links
    i'm not expert, i paid for fix, if anyone can fix my problem send me pm please
    it's urgent!
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Assuming XF is also installed in the web root (http://www.domain.com/), and assuming the ids are the same, try this:

    Code:
            location ~* ^/thread[0-9]+\.html$ {
                    rewrite thread([0-9]+)\.html$ /threads/$1/ permanent;
            }
    
            location ~* ^/forum[0-9]+\.html$ {
                    rewrite forum([0-9]+)\.html$ /forums/$1/ permanent;
            }
    
     
    younes likes this.
  10. younes

    younes Active Member

    thank you jake, it's working now (no More 404 :D )
    but my thread IDs in XF not the same as VB :( its redirecting to the wrong thread
     
  11. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Then upload these redirect scripts to your web root:

    http://xenforo.com/community/resources/redirection-scripts-for-vbulletin-3-x.264/

    If your import records are not in the xf_import_log table then you need to edit the 301config.php file to specify the name of the table.

    Then use these rules instead of the previous ones I posted:

    Code:
            location ~* ^/thread[0-9]+\.html$ {
                    rewrite thread([0-9]+)\.html$ /showthread.php?t=$1 permanent;
            }
    
            location ~* ^/forum[0-9]+\.html$ {
                    rewrite forum([0-9]+)\.html$ /forumdisplay.php?f=$1 permanent;
            }
    
    That will handle the change of id.
     
    younes likes this.
  12. younes

    younes Active Member

    Thank you so much jake (y)
    it works like a charm
     
  13. younes

    younes Active Member

    hello again :D
    i have a new problem
    how can redirect old thread pages to xenforo?
    i have too many big thread with +15 pages
    example:
    this link redirect correctly
    www.mysite.com/thread12978.html
    www.mysite.com/threads/11521

    but threads internal pages wont (error 404)
    www.mysite.com/thread12978-2.html
    www.mysite.com/threads/11521/page-2

    how can fix this?
    it's not important to redirected to exact page
    i mean if this link www.mysite.com/thread12978-2.html can be redirected to this link www.mysite.com/threads/11521 its ok for me :D
    thanks
     
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    (to replace the previous rules I posted)

    Code:
            location ~* ^/thread[0-9\-]+\.html$ {
                    rewrite thread([0-9]+)-([0-9]+)\.html$ /showthread.php?t=$1&page=$2 permanent;
                    rewrite thread([0-9]+)\.html$ /showthread.php?t=$1 permanent;
            }
    
            location ~* ^/forum[0-9]+\.html$ {
                    rewrite forum([0-9]+)\.html$ /forumdisplay.php?f=$1 permanent;
            }
    
    Then be sure to make this change to the showthread.php file:

    http://xenforo.com/community/thread...rect-from-vb4-2-with-vbseo.45667/#post-490490

    And make sure the number of posts per page is the same as your old forum such that the page redirects are appropriate:

    Admin CP -> Home -> Options -> Messages -> Messages Per Page
     
    ideenwerk and younes like this.
  15. DRaver

    DRaver Active Member

    Is this true? For that you must use the v3 files + rewrites and not the vb4 redirect files?
     
  16. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The vB3 and vB4 redirect scripts are almost the same.

    All redirects are a little different. If you are having trouble then I can provide instructions if you give me an example old and new URL.
     
  17. khairulzul

    khairulzul Member

    Last edited: May 28, 2015
  18. younes

    younes Active Member

  19. younes

    younes Active Member

    Hello again :D
    I change my PHP version from 5.4 to 7.0.2
    Now every old URL's redirected to the index :(
     
  20. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Code:
            location ~* ^/[0-9]+-[^\.]+\.html$ {
                    rewrite /([0-9]+)-[^\.]+\.html$ /showthread.php?t=$1 permanent;
            }
    
            location ~* ^/forum[0-9]+-[^\.]+\.html$ {
                    rewrite forum([0-9]+)-[^\.]+\.html$ /forumdisplay.php?f=$1 permanent;
            }
    
            location ~* ^/member[0-9]+\.html$ {
                    rewrite member([0-9]+)\.html$ /member.php?u=$1 permanent;
            }
    
     

Share This Page