rob
April 18, 2012 10:53AM
Hi there,

I'm running nginx and xenforo but need to rewrite some old legacy URL's (left over from vbulletin + vbseo)..

Here is just a very small selection of my config which I want to optimise as fully as possible:-
[code]
#Forum 26 main
location = /category-name-73/forum-name-26/ {
rewrite ^ /forums/forum-name.26/ permanent;
}

#Forum 26
location /category-name-73/forum-name-26/ {
#forum paging
rewrite ^/category-name-73/forum-name-26/index([\d]+).html /forums/forum-name.26/page-$1 permanent;

#thread paging (modified version of kier's redirect script)
rewrite [^/]+/([\d]+)-.+-([\d]+).html /showthread.php?t=$1&page=$2 last;

#thread
rewrite [^/]+/([\d]+)-.+.html /threads/redirectme.$1/ permanent;
}[/code]

If only I can optimise the above then I can transfer the same principle to the rest of my (huge) config file.

I've been told that its possible to optimise the above so that a visit to /category-name-73/forum-name-26/ or any path below it will run just one regex instead of potentially 4 as per the above code...

So, optimising the above... does anyone have any clue how to do this?

Thank you for any help offered,

Rob
Subject Author Posted

How to optimize these config / rewrite rules

rob April 18, 2012 10:53AM

Re: How to optimize these config / rewrite rules

rob April 18, 2012 10:54AM

Re: How to optimize these config / rewrite rules

Jonathan Matthews April 18, 2012 11:40AM

Re: How to optimize these config / rewrite rules

rob April 18, 2012 11:48AM

Re: How to optimize these config / rewrite rules

Jonathan Matthews April 18, 2012 12:52PM

Re: How to optimize these config / rewrite rules

rob April 18, 2012 01:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 70
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready