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

    668
    192
    43
    May 25, 2014
    Ratings:
    +272
    Local Time:
    6:02 AM
    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

    53,866
    12,160
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,712
    Local Time:
    10:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    maybe the full Nginx vhost might help
     
  3. BamaStangGuy

    BamaStangGuy Active Member

    668
    192
    43
    May 25, 2014
    Ratings:
    +272
    Local Time:
    6:02 AM
  4. eva2000

    eva2000 Administrator Staff Member

    53,866
    12,160
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,712
    Local Time:
    10:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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. rdan

    rdan Well-Known Member

    5,439
    1,399
    113
    May 25, 2014
    Ratings:
    +2,188
    Local Time:
    8:02 PM
    Mainline
    10.2
    For VBSEO preset 01, this one works for me.
     
  6. rdan

    rdan Well-Known Member

    5,439
    1,399
    113
    May 25, 2014
    Ratings:
    +2,188
    Local Time:
    8:02 PM
    Mainline
    10.2
    And I hard coded every forum node urls.
     
  7. prometheus

    prometheus Member

    39
    4
    8
    Jan 24, 2015
    Greece
    Ratings:
    +9
    Local Time:
    2:02 PM
    1.9.9
    10.1