Learn about Centmin Mod LEMP Stack today
Register Now

Xenforo Is anyone comfortable translating rewrites into nginx-speak?

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

  1. Derek

    Derek New Member

    28
    9
    3
    Aug 5, 2016
    Ratings:
    +16
    Local Time:
    9:02 PM
    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 New Member

    28
    9
    3
    Aug 5, 2016
    Ratings:
    +16
    Local Time:
    9:02 PM
    • Like Like x 1
  3. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    11:02 AM
    Nginx 1.13.x
    MariaDB 5.5
    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;
    }
    
     
    • Informative Informative x 1
  4. Derek

    Derek New Member

    28
    9
    3
    Aug 5, 2016
    Ratings:
    +16
    Local Time:
    9:02 PM
    I guess it wouldn't hurt. Less crawler errors...
     
    • Agree Agree x 1