Welcome to Centmin Mod Community
Register Now

Nginx Rewrite rules for Xenforo + Wordpress

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by .Rolex, Jan 27, 2015.

Tags:
  1. .Rolex

    .Rolex New Member

    4
    0
    1
    Jan 27, 2015
    Ratings:
    +0
    Local Time:
    8:33 AM
    I'm planning to bridge wordpress so I'll need to move xenforo root to a subdirectory. Anyone know the rewrite rules to redirect all xf links to the new subdirectory?

    any help is appreciated

     
  2. .Rolex

    .Rolex New Member

    4
    0
    1
    Jan 27, 2015
    Ratings:
    +0
    Local Time:
    8:33 AM
    @eva2000 any chance you can help buddy
     
  3. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    1:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Tricky, haven't really done such so not sure of the specifics.

    Maybe @Matt @BamaStangGuy @Andy @RoldanLT have come across Xenforo instances that had to do such ?

    maybe something like ?

    Code:
    location /threads {
           location = /threads/featured/ {
                    return 301 http://domain.com/newsubdir/threads/featured/;
           }
           location = /threads/history/ {
                    return 301 http://domain.com/newsubdir/threads/history/;
           }
           location ~^/threads/(.*)$ {
                    rewrite ^/threads/(.*)/$ http://domain.com/newsubdir/threads/$1/ last;
           }      
    }
    or replace http://domain.com/ part with with ^/

    not sure... probably best to test wordpress bridge and moving xf instance to sub directory on test copy of your forums first :)

    let us know how you do :)
     
  4. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    11:33 PM
    Mainline
    10.2
    I always recommend putting your forum into a sub domain instead of a folder inside wp directory.
    That way easy to redirect.
     
  5. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    1:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    ah yes.. that would be alot easier.. forgot about that LOL

    forum.yourdomain.com

    much easier :D
     
  6. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    11:33 PM
    Mainline
    10.2
    Yes, because having your forum inside WP has a lot of issues.
    WP rewrite rules might interfere right?
     
  7. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    1:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah that's why i said it would be tricky :)
     
  8. .Rolex

    .Rolex New Member

    4
    0
    1
    Jan 27, 2015
    Ratings:
    +0
    Local Time:
    8:33 AM
    @RoldanLT @eva2000

    it's just i like the domain/forums scheme rather than forums.domain hmm

    ill play around with it and keep you guys posted :)

    i won't be able to get around to it till friday since I have some midterms