ðòïåëôù 


  áòèé÷ 


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: Need help - rewrite from apache to nginx


  • To: nginx-ru@xxxxxxxxx
  • Subject: Re: Need help - rewrite from apache to nginx
  • From: Veaceslav Grecea <veaceslav.grecea@xxxxxxxxx>
  • Date: Tue, 20 Jul 2010 19:14:56 +0300
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=zIa/O77GFIsO5WjOKQ0j0JpWb7FF9E7dd270re+Xi/k=; b=rxW5+V2n0NMIBpuvXr3KQ7VNqJ2T16voTe2ISZsWQljpJ47D3v3897dO9txp4Oo6qZ rWuxYD/LEUTRASD23weSXkck0fyYLIHBJ4HcTTIo8JnX/n0z7G1JpQTcrbYlLHrCV+B1 mGNPKq0bToD0B9+nLCSyoT88KIAuPBvGlsvWY=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=hLnSxD6WsskMliN2NproTmqO6uaH/ehNfLIm7AgnOnboMkCHiXTkZKAQPx9PrlU4Rn qC/Srp9Xa9KqqknH0AlrlpPhz0A/IlX1y+So+PJGqsHNdT9oU3LHr91Lq+xjpvV6ST4R l3TkV8PWnrz4wbOiz2VJBgU6Qk3E6oromabvg=
  • In-reply-to: <20100719115826.GK47630@xxxxxxxxxxxxx>
  • References: <AANLkTin6QEBNNUskosEr638HGm2YR_vkYJmU-GYMQT5R@xxxxxxxxxxxxxx> <20100719115826.GK47630@xxxxxxxxxxxxx>

2010/7/19 Igor Sysoev <igor@xxxxxxxxx>
On Sun, Jul 18, 2010 at 08:22:35PM +0300, Veaceslav Grecea wrote:

> úÄÒÁ×ÓÔ×ÕÊÔÅ.
>
> åÓÔØ ×ÏÔ ÔÁËÉÅ ÒÅ×ÒÁÊÔ ÐÒÁ×ÉÌÁ:
>
> RewriteRule detail-property-results-([0-9]+).php$
> /results_detail.php?pageindex=$1&lang=en
> [NC,L]
> RewriteRule detail-property-results.php$
> /results_detail.php
> [NC,L]
> RewriteRule property/([0-9]+)/(.*).php$
> property-detail-2?propertyid=$1&lang=$2
> [R,L]
> RewriteRule property-results-([0-9]+).php$
> /results.php?pageindex=$1&lang=en
> [NC,L]
> RewriteRule property-results.php$
> /results.php?lang=en [NC,L]
>
> ñ ÕÖÅ ÄÅÎØ ÍÕÞÁÀÓØ É ÎÉËÁË ÎÅ ÍÏÇÕ ÐÅÒÅÎÅÓÔÉ ÉÈ ÐÏÄ ÌÏËÅÊÛÅÎÙ nginx-Á.
> èÏÔÑ ÂÙ ÐÒÉÍÅÒ ÐÏ ÐÅÒ×ÏÍÕ ÐÒÁ×ÉÌÕ.

ñ ÂÙ ÓÄÅÌÁÌ ÔÁË (ÐÉÓÁÔØ ÂÏÌØÛÅ, ÚÁÔÏ ÓÏÐÒÏ×ÏÖÄÁÔØ ÌÅÇÞÅ):

location /detail-property-results {

š šlocation = /detail-property-results.php {
š š š šfastcgi_pass š ...
š š š šfastcgi_param šSCRIPT_FILENAME š/path/to/results_detail.php;
š š š šfastcgi_param šQUERY_STIRNG š š "";
š š š šinclude š š š šfastcgi_params0;
š š}

š šlocation ~ ^/detail-property-results-([0-9]+)\.php$ {
š š š šfastcgi_pass š ...
š š š šfastcgi_param šSCRIPT_FILENAME š/path/to/results_detail.php;
š š š šfastcgi_param šQUERY_STIRNG š š pageindex=$1&lang=en;
š š š šinclude š š š šfastcgi_params0;
š š}

š šreturn 404;
}

location /property-results {

š šlocation = /property-results.php {
š š š šfastcgi_pass š ...
š š š šfastcgi_param šSCRIPT_FILENAME š/path/to/results.php;
š š š šfastcgi_param šQUERY_STIRNG š š lang=en;
š š š šinclude š š š šfastcgi_params0;
š š}

š šlocation ~ ^/property-results-([0-9]+)\.php$ {
š š š šfastcgi_pass š ...
š š š šfastcgi_param šSCRIPT_FILENAME š/path/to/results.php;
š š š šfastcgi_param šQUERY_STIRNG š š pageindex=$1&lang=en;
š š š šinclude š š š šfastcgi_params0;
š š}

š šreturn 404;
}

location /property/ {

š šlocation ~ ^/property/([0-9]+)/(.*)\.php$ {
š š š šreturn šhttp://$host/property-detail-2?propertyid=$1&lang=$2;
š š}

š šreturn 404;
}
hg_04, éÇÏÒØ, ÓÐÁÓÉÂÏ ÚÁ ÐÏÍÏÝØ.
äÅÊÓÔ×ÉÔÅÌØÎÏ, ÒÅÛÅÎÉÅ éÇÏÒÑ ÏÞÅÎØ ËÒÁÓÉ×Ï É ÜÌÅÇÁÎÔÎÏ. íÎÅ ×ÓÅ ÒÁ×ÎÏ ÓËÏÌØËÏ ÐÉÓÁÔØ, ÇÌÁ×ÎÏÅ ÞÔÏÂÙ ÂÙÌÏ ÐÒÁ×ÉÌØÎÏ É ÐÏÎÑÔÎÏ ÓÒÁÚÕ.
îÏ ÎÅËÏÔÏÒÙÅ ×ÅÝÉ ÎÅ ÒÁÂÏÔÁÀÔ: ÜÔÏÔ location ~ ^/property-results-([0-9]+)\.php$ ÐÏ ÇÅÔ-Õ ÎÅ ÐÅÒÅÄÁ£Ô ÚÎÁÞÅÎÉÑ É ÐÁÇÉÎÁÔÏÒ ÎÅ ÒÁÂÏÔÁÅÔ × ÒÅÚÕÌØÔÁÔÅ. ôÁÍ ÕÒÉ ÐÒÉÍÅÒÎÏ ×ÏÔ ÔÁËÏÅ:
/category/properties/detail-property-results-2.php
÷ÉÄÉÍÏš ÎÅ ÎÕÖÅÎ ^. éÌÉ Ñ ÎÅ ÐÒÁ× ?

ñ ÐÏÐÙÔÁÀÓØ ÐÏÏÂÝÁÔØÓÑ Ó ÐÒÏÇÒÁÍÍÅÒÏÍ ÎÁÓÞÅÔ ÜÔÏÇÏ.



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


 




Copyright © Lexa Software, 1996-2009.