Welcome! Log In Create A New Profile

Advanced

rewrite rul

July 20, 2011 01:59PM
Пытаюсь сконвертить следующие rewrite правила из синтаксиса mod_rewrite в синтаксис Nginx:

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
# Administration URL rewriting.
RewriteRule ^admin(.*)$ admin/index.php?$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
# Main URL rewriting.
RewriteRule ^(.*)$ index.php?PAGE=$1 [L,QSA]

второе правило удалось застравить работать, первое - никак.

конфиг такой:

server {
listen 80;
server_name domain.tld
location / {
root /v/http/domain.tld;
try_files $uri $uri/ @rewrite;
autoindex off;
}

location @rewrite {
rewrite ^/admin/(.*)$ /admin/index.php?$1;
rewrite ^/(.*)$ /index.php?PAGE=$1;
}


location ~ \.php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param DOCUMENT_ROOT /v/http/domain.tld;
fastcgi_param SCRIPT_FILENAME /v/http/domain.tld$fastcgi_script_name;
include fastcgi_params;
}
}

Где я ошибся? Почему для /admin/ не срабатывает правило?
Subject Author Posted

rewrite rul

yokodzun July 20, 2011 01:59PM

Re: rewrite rul

Igor Sysoev July 20, 2011 03:06PM

rewrite

Gena Makhomed July 20, 2011 03:54PM

Re: rewrite rul

yokodzun July 21, 2011 03:23AM

Re: rewrite rul

Igor Sysoev July 21, 2011 03:32AM

Re: rewrite rul

yokodzun July 21, 2011 05:11PM

Re: rewrite rul

Igor Sysoev July 22, 2011 09:28AM

Re: rewrite rul

yokodzun July 22, 2011 11:24AM

Re: rewrite rul

Igor Sysoev July 22, 2011 11:28AM

Re: rewrite rul

yokodzun July 25, 2011 03:22AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 85
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready