Welcome! Log In Create A New Profile

Advanced

Rewrite .htaccess для nginx

October 03, 2014 03:45PM
Доброго времени суток.

Пытаюсь преобразовать такую конструкцию

RewriteRule ^category-(.*)-(.*).html index.php?$2 [QSA,L,NC]
RewriteRule ^forum-(.*)-(.*).html forum.php?$2 [QSA,L,NC]
RewriteRule ^topic-(.*)-(.*).html topic.php?$2 [QSA,L,NC]

для nginx

так

location /category {
rewrite ^/category-(.*)-(.*).html /index.php?$2 break;
}
location /forum {
rewrite ^/forum-(.*)-(.*).html /forum.php?$2 break;
}
location /topic {
rewrite ^/topic-(.*)-(.*).html /topic.php?$2 break;
}

или так

rewrite ^/category-(.*)-(.*).html /index.php/$2 last;
rewrite ^/forum-(.*)-(.*).html /forum.php/$2 last;
rewrite ^/topic-(.*)-(.*).html /topic.php/$2 last;


Ни один вариант не срабатывает.
Subject Author Posted

Rewrite .htaccess для nginx

kiber October 03, 2014 03:45PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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