Welcome to Centmin Mod Community
Become a Member

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 Well-Known Member

    3,936
    961
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,312
    Local Time:
    5:46 AM
    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

    30,605
    6,862
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,297
    Local Time:
    7:46 AM
    Nginx 1.13.x
    MariaDB 5.5
  3. RoldanLT

    RoldanLT Well-Known Member

    3,936
    961
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,312
    Local Time:
    5:46 AM
    1.11
    10.2
    I have tried several approach already but not working as Intended.
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,605
    6,862
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,297
    Local Time:
    7:46 AM
    Nginx 1.13.x
    MariaDB 5.5
    post what you've tried so far with full vhost file
     
  5. RoldanLT

    RoldanLT Well-Known Member

    3,936
    961
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,312
    Local Time:
    5:46 AM
    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 Well-Known Member

    3,936
    961
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,312
    Local Time:
    5:46 AM
    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 Well-Known Member

    3,936
    961
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,312
    Local Time:
    5:46 AM
    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

    30,605
    6,862
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,297
    Local Time:
    7:46 AM
    Nginx 1.13.x
    MariaDB 5.5