1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help with nginx vbseo-vbulletin rewrites?

Discussion in 'Server Configuration and Hosting' started by kontrabass, Mar 17, 2016.

  1. kontrabass

    kontrabass Well-Known Member

    I'm having trouble with some quirky vbulletin vbseo url's. Here's what I have in my nginx server config file:

    location / {
    rewrite ^/forum/f[0-9]+/.+-([0-9]+)/$ /threads/$1/ redirect;
    rewrite ^/forum/f([0-9]+)/$ /forums/$1/ redirect;
    ...


    This works great for old url's like
    Code:
    https://www.talkbass.com/forum/f8/official-show-your-basses-thread-part-16-a-851761/
    and
    Code:
    https://www.talkbass.com/forum/f8/
    But here's where I need help. Apparently my old posts are full of URL's that have a .html at the end, like:
    Code:
    https://www.talkbass.com/forum/f8/official-show-your-basses-thread-part-16-a-851761/index5.html
    How can I edit the rewrite rule such that it just plain ignores the "index5.html"?

    Also, is there a way to change the rewrite rule so that it doesn't *require* a trailing slash? Old url's without a trailing slash are not rewritten correctly.

    Thanks!
     

Share This Page