Learn about Centmin Mod LEMP Stack today
Register Now
  1. Letsencrypt SSL Certificate integration via public beta testing of acmetool.sh addon has begun !. Centmin Mod LEMP powered sites will be able to automatically get free SSL certificates to use with their Nginx HTTP/2 based SSL enabled web sites. To help test Letsencrypt SSL integration, read instructions here.

    Dismiss Notice

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,599
    877
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,157
    Local Time:
    10:13 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

    23,565
    5,508
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +7,852
    Local Time:
    12:13 PM
    Nginx 1.11.x
    MariaDB 5.5
  3. RoldanLT

    RoldanLT Premium Member Premium Member

    3,599
    877
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,157
    Local Time:
    10:13 AM
    1.11
    10.2
    I have tried several approach already but not working as Intended.
     
  4. eva2000

    eva2000 Administrator Staff Member

    23,565
    5,508
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +7,852
    Local Time:
    12:13 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,599
    877
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,157
    Local Time:
    10:13 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 Premium Member Premium Member

    3,599
    877
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,157
    Local Time:
    10:13 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 Premium Member Premium Member

    3,599
    877
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,157
    Local Time:
    10:13 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

    23,565
    5,508
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +7,852
    Local Time:
    12:13 PM
    Nginx 1.11.x
    MariaDB 5.5