Get the most out of your Centmin Mod LEMP stack
Become a Member

Xenforo vB to XF Rewrite Help

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

  1. BoostN

    BoostN Active Member

    134
    27
    28
    Aug 19, 2014
    Ratings:
    +42
    Local Time:
    2:52 PM
    1.13.6
    10.0.34
    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. rdan

    rdan Well-Known Member

    5,443
    1,402
    113
    May 25, 2014
    Ratings:
    +2,194
    Local Time:
    4:52 AM
    Mainline
    10.2
  3. eva2000

    eva2000 Administrator Staff Member

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:52 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  4. BoostN

    BoostN Active Member

    134
    27
    28
    Aug 19, 2014
    Ratings:
    +42
    Local Time:
    2:52 PM
    1.13.6
    10.0.34
  5. eva2000

    eva2000 Administrator Staff Member

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:52 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    really depends on how you setup vb default non-vbseo urls

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

    BoostN Active Member

    134
    27
    28
    Aug 19, 2014
    Ratings:
    +42
    Local Time:
    2:52 PM
    1.13.6
    10.0.34
    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

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:52 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Last edited: Nov 1, 2014
  8. BoostN

    BoostN Active Member

    134
    27
    28
    Aug 19, 2014
    Ratings:
    +42
    Local Time:
    2:52 PM
    1.13.6
    10.0.34
    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

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:52 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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 Active Member

    134
    27
    28
    Aug 19, 2014
    Ratings:
    +42
    Local Time:
    2:52 PM
    1.13.6
    10.0.34
    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

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:52 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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 Active Member

    134
    27
    28
    Aug 19, 2014
    Ratings:
    +42
    Local Time:
    2:52 PM
    1.13.6
    10.0.34
    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:
    12:52 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...