Get the most out of your Centmin Mod LEMP stack
Become a Member

Nginx Rewrite Help

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

  1. BamaStangGuy

    BamaStangGuy Active Member

    663
    189
    43
    May 25, 2014
    Ratings:
    +268
    Local Time:
    7:43 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

    48,887
    11,189
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,423
    Local Time:
    10:43 PM
    Nginx 1.21.x
    MariaDB 10.x
    maybe the full Nginx vhost might help
     
  3. BamaStangGuy

    BamaStangGuy Active Member

    663
    189
    43
    May 25, 2014
    Ratings:
    +268
    Local Time:
    7:43 AM
  4. eva2000

    eva2000 Administrator Staff Member

    48,887
    11,189
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,423
    Local Time:
    10:43 PM
    Nginx 1.21.x
    MariaDB 10.x
    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 Premium Member Premium Member

    5,294
    1,315
    113
    May 25, 2014
    Ratings:
    +2,036
    Local Time:
    8:43 PM
    Mainline
    10.2
    For VBSEO preset 01, this one works for me.
     
  6. rdan

    rdan Premium Member Premium Member

    5,294
    1,315
    113
    May 25, 2014
    Ratings:
    +2,036
    Local Time:
    8:43 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:
    3:43 PM
    1.9.9
    10.1