March 14, 2013 01:11PM
Нужно переводить ссылку вида site.ru/back/struct в site.ru/back/index.php/struct и отдавать в пхп.
Пытаюсь написать конфиг под подобное поведение, но ничего не получается. В апаче было просто: .htaccess файл в директорию back и текстом RewriteRule ^(.*)$ index.php [L,QSA]. В nginx способ до сих пор не нашёл.
Вот, например, один из вариантов:
location /back {
if (!-e $request_filename) {
rewrite ^/(.*) /back/index.php/$1;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

# With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Выдаёт 500-ю ошибку. Помогите, пожалуйста.
Subject Author Posted

rewtite /back/struct => /back/index.php/struct

botbot March 14, 2013 01:11PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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