Welcome! Log In Create A New Profile

Advanced

Re: nginx rewrite rule

Andrey Kopeyko
January 15, 2019 05:12PM
On Tue, 15 Jan 2019, dmprog08 wrote:

> Как настроить рулзы чтобы когда я вводил такой урл
> http://admin.1851.local/assets/814baced/css/style_v1.css перенаправляло на
> http://admin.1851.local/assets/814baced/css/style.css
> http://admin.1851.local/assets/814baced/css/style_v2.css перенаправляло на
> http://admin.1851.local/assets/814baced/css/style.css
> то есть просто
> style_v1.css => style.css
> style_v2.css => style.css
>

Зачем вам "рулзы"? сделайте надёжно

location ^~ ^/(assets/814baced/css/style)_v(1|2).css {
return 301 http://$host/$1.css;
}


--
Best regards,
Andrey Kopeyko <andrey@kopeyko.ru>_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

nginx rewrite rule

dmprog08 January 15, 2019 10:49AM

Re: nginx rewrite rule

Andrey Kopeyko January 15, 2019 05:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 64
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