Join the community today
Register Now

Nginx Move XenForo Forum from root folder to /community/, Help with proper redirect :|

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by RoldanLT, Jan 11, 2017.

  1. RoldanLT

    RoldanLT Premium Member Premium Member

    3,727
    913
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,222
    Local Time:
    1:12 PM
    1.11
    10.2
    I just want to preserve:
    • /threads/
    • /forums/
    • /category/
    • /members/
    • /p/
    to auto redirect to new location:
    • /community/threads/
    • /community/forums/
    • /community/category/
    • /community/members/
    • /community/p/

     
  2. eva2000

    eva2000 Administrator Staff Member

    26,559
    6,095
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +8,937
    Local Time:
    3:12 PM
    Nginx 1.11.x
    MariaDB 5.5
  3. RoldanLT

    RoldanLT Premium Member Premium Member

    3,727
    913
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,222
    Local Time:
    1:12 PM
    1.11
    10.2
    I have tried several approach already but not working as Intended.
     
  4. eva2000

    eva2000 Administrator Staff Member

    26,559
    6,095
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +8,937
    Local Time:
    3:12 PM
    Nginx 1.11.x
    MariaDB 5.5
    post what you've tried so far with full vhost file
     
  5. RoldanLT

    RoldanLT Premium Member Premium Member

    3,727
    913
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,222
    Local Time:
    1:12 PM
    1.11
    10.2
    This code:
    Code:
    location ~* ^(threads|forums|members)/.*$ {
            rewrite (threads|forums|members)/(.*)$ /community/$1/$2 permanent;
            }
    But doesn't work.
     
  6. RoldanLT

    RoldanLT Premium Member Premium Member

    3,727
    913
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,222
    Local Time:
    1:12 PM
    1.11
    10.2
    Code:
    rewrite ^(domain.com/threads/)(.*) http://domain.com/threads/community/$2 redirect;
        rewrite ^(domain.com/forums/)(.*) http://domain.com/forums/community/$2 redirect;
    Code:
    rewrite ^(/threads/)(.*) http://domain.com/threads/community/$2 redirect;
        rewrite ^(/forums/)(.*) http://domain.com/forums/community/$2 redirect;
    Code:
    rewrite http://domain.com/threads/(.*) http://domain.com/threads/community/$2 redirect;
        rewrite http://domain.com/forums/(.*) http://domain.com/forums/community/$2 redirect;
    Still not working on this code.
     
  7. RoldanLT

    RoldanLT Premium Member Premium Member

    3,727
    913
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,222
    Local Time:
    1:12 PM
    1.11
    10.2
    Doesn't work also:
    Code:
    rewrite http://domain.com/threads/(.*)$ http://domain.com/threads/community/$1;
        rewrite http://domain.com/forums/(.*)$ http://domain.com/forums/community/$1;
     
  8. eva2000

    eva2000 Administrator Staff Member

    26,559
    6,095
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +8,937
    Local Time:
    3:12 PM
    Nginx 1.11.x
    MariaDB 5.5