Want to subscribe to topics you're interested in?
Become a Member

Xenforo Is anyone comfortable translating rewrites into nginx-speak?

Discussion in 'Forum software usage' started by Derek, Oct 18, 2016.

  1. Derek

    Derek Member

    47
    9
    8
    Aug 5, 2016
    Ratings:
    +22
    Local Time:
    4:25 AM
    I'd like to apologize up front if this isn't clear. I'm running on way too little sleep and things are getting muddy.


    I just migrated vBulletin 3.8 --> Xenforo, and I'm getting less hate from the users than I expected, so that's good.

    Old links weren't working, so I installed the import redirection tool and most links are fine now. But Google linked to our archive, and those are 404-ing.

    Apparently if I was running Apache this would work:

    Code:
    RewriteRule ^archive/index\.php/t-([0-9]+)\.html$ http://yoursite.com/index.php?threads/$1/ [R=301,L] 
    or 
    RewriteRule ^archive/index\.php/t-([0-9]+)\.html$ /index.php?threads/$1/ [R=301,L]
    But I'm not, and I'm just not capable of learning this right now. Can anyone tell me how to convert this into something nginx could perform?

    Thanks.
     
  2. Derek

    Derek Member

    47
    9
    8
    Aug 5, 2016
    Ratings:
    +22
    Local Time:
    4:25 AM
  3. eva2000

    eva2000 Administrator Staff Member

    55,153
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    6:25 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    ah surprised that rule convertor gave a correct conversion, usually it doesn't for some heh

    you don't need one for forums just threads ?
    Code (Text):
    location ~ /archive {
      rewrite ^/archive/index.php/t-([0-9]+)\.html /threads/$1/ last;
      rewrite ^/archive/index.php/f-([0-9]+)\.html /forums/$1/ last;
    }
    
     
  4. Derek

    Derek Member

    47
    9
    8
    Aug 5, 2016
    Ratings:
    +22
    Local Time:
    4:25 AM
    I guess it wouldn't hurt. Less crawler errors...