rewrite rule

Merlin merlin at mahalo.com
Tue Mar 3 02:44:16 MSK 2009


Apache:
  RewriteRule ^images/e/(.*)$ http://thumbs.ebaystatic.com/pict/$1 [R,L]
NginX:
  rewrite ^/images/e/(.*)$ http://thumbs.ebaystatic.com/pict/$1 permanent;

If you compare what you sent and what Igor replied with, it should be pretty
clear that the omitted rule should be very similar.  It wouldn't hurt to
take some time to learn regular expressions, either:
http://www.google.com/search?hl=en&q=learn+regular+expressions+now!&btnG=Search

On Mon, Mar 2, 2009 at 6:20 AM, Max <maxbear at gmail.com> wrote:

> Thanks a lot for the rewrite rule.
>
> I posted the wrong rewrite rule:-( in my origial post. This is the one that
> I want to change:
>
> RewriteEngine On
> RewriteBase /
> RewriteRule ^images/e/(.*)$ http://thumbs.ebaystatic.com/pict/$1 [R,L]
> RewriteRule ^item-(.*)_(.*)_(.*)_(.*).html$
> auction.php?title=$1&item=$2&country=$3&ccid=$4
> RewriteRule ^item-(.*)_(.*)_(.*).html$
> auction.php?title=$1&item=$2&country=$3
> RewriteRule ^item-(.*)_(.*).html$ auction.php?title=$1&item=$2
>
> Could someone help me to make it work? Thanks a lot :-).
>
> Max
>
>
> On Sun, Mar 1, 2009 at 11:51 PM, Igor Sysoev <is at rambler-co.ru> wrote:
>
>> On Sun, Mar 01, 2009 at 09:58:25PM +0800, Max wrote:
>>
>> > I tried to change the following apache rewrite to work under nginx. But
>> it's
>> > still not working.
>> >
>> > RewriteEngine On
>> > RewriteBase /
>> > RewriteRule ^item-(.*)_(.*)_(.*)_(.*).html$
>> > auction.php?title=$1&item=$2&country=$3&ccid=$4
>> > RewriteRule ^item-(.*)_(.*)_(.*).html$
>> > auction.php?title=$1&item=$2&country=$3
>> > RewriteRule ^item-(.*)_(.*).html$ auction.php?title=$1&item=$2
>> >
>> > Could anyone teach me how can I do it correctly? Thanks a lot.
>>
>>       location /item- {
>>           rewrite  ^/item-(.*)_(.*)_(.*)_(.*).html$
>>                     /auction.php?title=$1&item=$2&country=$3&ccid=$4
>>                     last;
>>
>>           rewrite  ^/item-(.*)_(.*)_(.*).html$
>>                     /auction.php?title=$1&item=$2&country=$3
>>                     last;
>>
>>           rewrite  ^/item-(.*)_(.*).html$
>>                     /auction.php?title=$1&item=$2
>>                     last;
>>      }
>>
>>
>> --
>> Igor Sysoev
>> http://sysoev.ru/en/
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090302/6f9d3433/attachment.html>


More information about the nginx mailing list