Learn about Centmin Mod LEMP Stack today
Become a Member

Xenforo vB to XF Rewrite Help

Discussion in 'Forum software usage' started by BoostN, Nov 1, 2014.

  1. BoostN

    BoostN Member

    88
    18
    8
    Aug 19, 2014
    Ratings:
    +22
    Local Time:
    6:27 PM
    1.11.1
    10.0.28
    I'm converting on of my forums from vB (no VBSEO, just vB URLs) to XF within the week.. I'm planning everything now.

    I'm looking for the Nginx rewrites for converting the URLs. I've searched on the XF site but I'm not having much luck (or confidence) for that matter.
     
  2. RoldanLT

    RoldanLT Well-Known Member

    3,823
    929
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,257
    Local Time:
    7:27 AM
    1.11
    10.2
  3. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,751
    Local Time:
    9:27 AM
    Nginx 1.13.x
    MariaDB 5.5
  4. BoostN

    BoostN Member

    88
    18
    8
    Aug 19, 2014
    Ratings:
    +22
    Local Time:
    6:27 PM
    1.11.1
    10.0.28
  5. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,751
    Local Time:
    9:27 AM
    Nginx 1.13.x
    MariaDB 5.5
    really depends on how you setup vb default non-vbseo urls

    @BamaStangGuy probably has more experience with vB to XF conversions
     
  6. BoostN

    BoostN Member

    88
    18
    8
    Aug 19, 2014
    Ratings:
    +22
    Local Time:
    6:27 PM
    1.11.1
    10.0.28
    Current (OLD) URL:
    Code:
    http://www.thetruckstop.us/forum/showthread.php?36935-2003-lb7-injector-replacement
    XF will have friend urls enabled.. and be in the same /forum/ structure.
     
  7. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,751
    Local Time:
    9:27 AM
    Nginx 1.13.x
    MariaDB 5.5
    Last edited: Nov 1, 2014
  8. BoostN

    BoostN Member

    88
    18
    8
    Aug 19, 2014
    Ratings:
    +22
    Local Time:
    6:27 PM
    1.11.1
    10.0.28
    Anyone know the best way to handle the vBulletin forum.php URL? It comes up as a 404 in Nginx, any pointers for a rewrite to fix that?
     
  9. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,751
    Local Time:
    9:27 AM
    Nginx 1.13.x
    MariaDB 5.5
    just do a normal nginx rewrite from A to B where A = forum.php and B = / or /forum if it's a subdirectory
     
  10. BoostN

    BoostN Member

    88
    18
    8
    Aug 19, 2014
    Ratings:
    +22
    Local Time:
    6:27 PM
    1.11.1
    10.0.28
    Current config:
    Code:
    location /{
    rewrite ^/(.*) http://www.$server_name/forum/ permanent;
    }
    
    location /forum/ {
    index index.php index.html index.htm;
    try_files $uri $uri/ /forum/index.php?$uri&$args;
    
    }
    
    location /forum/internal_data/ {
    internal;
    allow 127.0.0.1;
    deny all;
    }
    
    location /forum/library/ {
    internal;
    allow 127.0.0.1;
    deny all;
    }
    
    location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    }
    I tried adding:
    Code:
    rewrite /(forum.php)$ /forum/index.php last;

    to my forum block but no luck..
     
  11. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,751
    Local Time:
    9:27 AM
    Nginx 1.13.x
    MariaDB 5.5
    it's probably because you your catchall redirect all in / to redirect to /forum/ causing problems?

    Code:
    location /{
    rewrite ^/(.*) http://www.$server_name/forum/ permanent;
    }
    that should catch /forum.php I believe already?

    usually without the catchall redirect you have, would be something like

    note: placed outside of any existing location block

    Code:
    rewrite ^/forum.php$ /forum/index.php permanent; 
    or just create a new forum.php with a php location header redirect to /forum

    You're on your own for the rest unless other members would like to chime in :)
     
  12. BoostN

    BoostN Member

    88
    18
    8
    Aug 19, 2014
    Ratings:
    +22
    Local Time:
    6:27 PM
    1.11.1
    10.0.28
    I just created a new forum.php file and redirected that way with success! Thanks!
     
  13. jeffwidman

    jeffwidman Active Member

    152
    27
    28
    Dec 3, 2014
    Ratings:
    +51
    Local Time:
    4:27 PM
    @BoostN did you ever get this figured out?

    I'm looking for the same thing... VB 4.2 basic urls --> XF urls. Content ID's stayed the same, so just need to rewrite the URL format.

    I don't want the overhead that the addon requires of hitting PHP on redirects, much rather just handle it with Nginx rewrite rules.

    I'm comfortable with regex's and Nginx rewrites/location blocks, but looking for some example rewrite regex's to get me started and save time.

    cc @eva2000 @BamaStangGuy as I think you've both also migrated VB 4 forums over to XF...