Join the community today
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:
    7:52 PM
    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:
    7:52 PM
    @eva2000 any chance you can help buddy
     
  3. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    12:52 PM
    Nginx 1.13.x
    MariaDB 5.5
    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 :)
     
    • Like Like x 1
  4. RoldanLT

    RoldanLT Well-Known Member

    3,829
    929
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,258
    Local Time:
    10:52 AM
    1.11
    10.2
    I always recommend putting your forum into a sub domain instead of a folder inside wp directory.
    That way easy to redirect.
     
    • Like Like x 2
  5. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    12:52 PM
    Nginx 1.13.x
    MariaDB 5.5
    ah yes.. that would be alot easier.. forgot about that LOL

    forum.yourdomain.com

    much easier :D
     
    • Like Like x 1
  6. RoldanLT

    RoldanLT Well-Known Member

    3,829
    929
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,258
    Local Time:
    10:52 AM
    1.11
    10.2
    Yes, because having your forum inside WP has a lot of issues.
    WP rewrite rules might interfere right?
     
    • Like Like x 1
  7. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    12:52 PM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah that's why i said it would be tricky :)
     
    • Like Like x 1
  8. .Rolex

    .Rolex New Member

    4
    0
    1
    Jan 27, 2015
    Ratings:
    +0
    Local Time:
    7:52 PM
    @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