ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rewrite engine


  • To: nginx-ru@xxxxxxxxx
  • Subject: Re: Rewrite engine
  • From: Алферов Василий <vasilii.alferov@xxxxxxxxx>
  • Date: Fri, 20 Aug 2010 15:25:20 +0600
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=K6FiUTiHEIIpn96zF+x/KXXqvIPXBsBsbZNfvtzBSdQ=; b=PQnpXmwf/FeZ2Ri3LL/NCmtgqTtlJesgsThEKNwxKiPLlI3cmI3iw15xUZgz5bauj9 fVw/FOpqLPOdwzEkXGGB4ypPcianu20G5Dzv0FAaGPY8SMB2+FV2EHEMKGKIygfVsqo4 yw/joi0cGNKU92uAWb/AI2nciGO8cGMghhYFU=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=uTuHDSGeW3hlWw7VfJhIEXzY0FfjIyj8+n8UAAL+2KKYE8Kxx1d2DwUIoV/ZOi/hHD G9IirmMdu6oa8+1ynptNcqnBDr+DFUbzzWnz2Z/kkD8I8NlUvPv6fpvFnfNqDuaOKfRw 5NccjnvT7mkKtZLZS0bN4dSM/yDGYIAxxr/LE=
  • In-reply-to: <a3a6ba1357230b729485a95dfc2abae8.NginxMailingListRussian@xxxxxxxxxxxxxxx>
  • References: <a3a6ba1357230b729485a95dfc2abae8.NginxMailingListRussian@xxxxxxxxxxxxxxx>

rewrite ^/(.php)$ /index.php?/$1 last;
переписывает /aaaa.php -> /index.php?/.php

возможно вы имели в виду 
^/(.*)$ /index.php?$1
?

2010/8/20 Grohotun <nginx-forum@xxxxxxxx>
Всем добрый день!
Переношу одну систему на nginx + fastcgi c
апача.
В системе стоит такой .htaccess:

AddDefaultCharset UTF-8
DirectoryIndex index.php

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]


по идее он должен всё передавать с
index.php?auth/login на index.php/auth/login
Но не хочет.
Конф хоста:
server {
listen 80;
server_name stat.*********.ru;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log debug;

location / {
       root /var/www/lider;
       index index.php;
       rewrite_log on;

       if (!-f $request_filename){
               set $rule_0 1$rule_0;
       }
       if (!-d $request_filename){
               set $rule_0 2$rule_0;
       }
       if ($rule_0 = "21"){
               rewrite ^/(.php)$ /index.php?/$1 last;
       }

}
location ~ \.php$ {
       root /var/www/lider;
       fastcgi_pass 127.0.0.1:9000;
       fastcgi_index index.php;
       fastcgi_param SCRIPT_FILENAME
/var/www/lider$fastcgi_script_name;
       include fastcgi_params;
       }
}

Соответсвенно в логих пишется:
2010/08/20 11:02:58 [notice] 16433#0: *1 "^/(.*)$" matches
"/index.php/auth/login", client: 77.241.**.**, server: stat.*******.ru,
request: "GET /index.php/auth/login HTTP/1.1", host:
"stat.**********.ru"
2010/08/20 11:02:58 [notice] 16433#0: *1 rewritten data: "/index.php",
args: "/index.php/auth/login", client: 77.241.***.***, server:
stat.*******ru, request: "GET /index.php/auth/login HTTP/1.1", host:
"stat.********.ru"


Не поможете?

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,121618,121618#msg-121618


_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.