Learn about Centmin Mod LEMP Stack today
Become a Member

Nginx Rewrite Help

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by BamaStangGuy, May 14, 2015.

  1. BamaStangGuy

    BamaStangGuy Active Member

    465
    136
    43
    May 25, 2014
    Ratings:
    +179
    Local Time:
    1:44 PM
    Thanks to Slavik, we are on XenForo now with http://www.christianforums.com

    However, I can't get the url redirects to work for Nginx.

    Here is what I have:

    rewrite ^/t([\d]+)-([\d]+)/$ /showthread.php?t=$1&page=$2 permanent;
    rewrite ^/t([\d]+)/$ /showthread.php?t=$1 permanent;
    rewrite ^/t([\d]+)-([\d]+)/$ /forumdisplay.php?f=$1&page=$2 last;
    rewrite ^/t([\d]+)/$ /forumdisplay.php?f=$1 last;

    for the urls:

    Christian Forums
    http://www.christianforums.com/f445/

    They just redirect to the homepage.

    I have checked 301config.php and xf_import_log is defined correctly as well as the file path to xenforo install.

    What am I missing here?
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,034
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,784
    Local Time:
    4:44 AM
    Nginx 1.13.x
    MariaDB 5.5
    maybe the full Nginx vhost might help
     
  3. BamaStangGuy

    BamaStangGuy Active Member

    465
    136
    43
    May 25, 2014
    Ratings:
    +179
    Local Time:
    1:44 PM
  4. eva2000

    eva2000 Administrator Staff Member

    29,034
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,784
    Local Time:
    4:44 AM
    Nginx 1.13.x
    MariaDB 5.5
    You can see even accessing http://www.christianforums.com/showthread.php without any vlaues redirects to index which AFAIK shouldn't do that

    Curious as you have done other vB to XF migrations on Nginx, did these same rewrites in same vhost syntax work before ? Or is it first time you tried this set of rewrites in Centmin Mod Nginx/ regular Nginx ?

    Try moving the 4 rewrites out of location root / context so they're not wrapped in any location context. i.e. above location / context
     
  5. RoldanLT

    RoldanLT Well-Known Member

    3,830
    929
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,258
    Local Time:
    2:44 AM
    1.11
    10.2
    For VBSEO preset 01, this one works for me.
     
    • Informative Informative x 1
  6. RoldanLT

    RoldanLT Well-Known Member

    3,830
    929
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,258
    Local Time:
    2:44 AM
    1.11
    10.2
    And I hard coded every forum node urls.
     
    • Like Like x 1
  7. prometheus

    prometheus Member

    39
    4
    8
    Jan 24, 2015
    Greece
    Ratings:
    +9
    Local Time:
    9:44 PM
    1.9.9
    10.1
    • Informative Informative x 2
    • Like Like x 1