Welcome! Log In Create A New Profile

Advanced

Re: Как настроить 301й редирект на nginx

Vladimir Getmanshchuk
December 21, 2014 03:20PM
как то так, если я не ошибся в регулярке:

location ~* shopby {
rewrite ^/(.*)/shopby/.*\.html$ /$1.html permanent;
}

но уверен есть способы поизящнее...

On Sun, Dec 21, 2014 at 3:20 PM, Gavich <nginx-forum@nginx.us> wrote:

> Нужно сделать редирект с страниц вида
> /цифры_буквы_дефис_1/shopby/цифры_буквы_дефис_2.html
> на /цифры_буквы_дефис_1.html.
> Например с
> /196-vse-dlja-zhenschin/shopby/sisley-rimowa-ianis_chamalidy.html
> на 196-vse-dlja-zhenschin.html
> Как изменить конфиг сайта?
>
> Сейчас настройки сайта такие:
>
> server {
> server_name moda-spb.ru www.moda-spb.ru;
> listen 176.9.36.66;
> root /var/www/moda-spb.ru;
> index index.php;
>
> location / {
> index index.html index.php;
> try_files $uri $uri/ @handler;
> expires 30d;
> }
>
> location ^~
> /(app|includes|lib|media/downloadable|pkginfo|report/config.xml|var)/ {
> internal; }
> location /var/export/ { internal; }
> location /. { return 404; }
> location @handler { rewrite / /index.php; }
> location ~* .php/ { rewrite ^(.*.php)/ $1 last; }
> location ~* .php$ {
> if (!-e $request_filename) { rewrite / /index.php last; }
> expires off;
> fastcgi_pass php-fpm;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> fastcgi_param MAGE_RUN_CODE default;
> fastcgi_param MAGE_RUN_TYPE store;
> include fastcgi_params;
> }
> }
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?21,255708,255708#msg-255708
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru




--
Yours sincerely,
Vladimir Getmanshchuk
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Как настроить 301й редирект на nginx

Gavich December 21, 2014 08:20AM

Re: Как настроить 301й редирект на nginx

Vladimir Getmanshchuk December 21, 2014 03:20PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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