Welcome! Log In Create A New Profile

Advanced

Re: Nginx redirect/rewrite Rule

Francis Daly
December 30, 2015 12:06PM
On Sat, Dec 26, 2015 at 06:42:44AM -0500, Nginx Forum wrote:

Hi there,

> Old Url
> http://www.mydomain.com.br/forum/elsword-downloads-de-cheats-utilitarios/2369461-26-04-revolution-trainer-elsword.html
>
> 1. /forum/ - It is the folder that installed vbulletin
> 2. /elsword-downloads-de-cheats-utilitarios/ - is the forum name that the
> topic / in xenforo will not appear
> 3. 2369461 - is the ID that will have to appear in the url xenforo
> 4. -26-04-revolution-trainer-elsword.html - is the topic name that
> accessing, no matter what the xenforo because with the right ID it corrects
> the topic name in the URL.
>
>
> New Url
> http://www.mydomain.com.br/threads/26-04-revolution-trainer-elsword.2369461/
>
> 1. /threads/ - the xenforo automatically add the address when accessing this
> one topic.
> 2. 26-04-revolution-trainer-elsword - Topic name, even if the xenforo system
> corrects'm wrong
> 3. 2369461 - Most importantly, the topic ID

Every request below /forum/ will be redirected (if it matches this
pattern) or return 404 (if it does not). You may prefer to change the
404 to return a redirect to /threads/, for example.

===
location ^~ /forum/ {
location ~ ^/forum/[^/]*/([0-9]*)-(.*).html$ {
return 301 /threads/$2.$1/;
}
return 404;
}
===

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx redirect/rewrite Rule

marcostutu December 26, 2015 06:42AM

Re: Nginx redirect/rewrite Rule

Francis Daly December 30, 2015 12:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 233
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready