помогите переделать правило rewrite

Sergey Shepelev temotor at gmail.com
Fri May 16 17:47:25 MSD 2008


У nginx нет mod_php. Нужно настраивать FastCGI бекенд.

Регекспы можно упростить до (\d*)-([\d\w_]*)
хотя могу и ошибаться с регекспами.

Denis Kot пишет:
> хм, вроде начало отрабатывать, но теперь в огнелисе предлагает
> сохранить файл, а в IE возвращает код php.
> 
> 16 мая 2008 г. 14:54 пользователь Denis Kot <denis.kot at gmail.com> написал:
>> есть вот такой вот .htaccess
>> RewriteRule ^([0123456789]*)-([0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_]*)\.png$
>> torrentbar.php?id=$1&style=$2 [L]
>> RewriteRule ^(.*)/([0123456789]*)-([0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_]*)\.png$
>> torrentbar.php?id=$2&style=$3 [L]
>>
>> RewriteRule ^(.*)/([0123456789]*)\.png$ torrentbar.php?id=$2 [L]
>> RewriteRule ^([0123456789]*)\.png$ torrentbar.php?id=$1 [L]
>>
>> попробывал сделать так:
>>    location /forum/torrentbar/ {
>>        rewrite
>> ^/forum/torrentbar/([0123456789]*)-([0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_]*)\.png$
>> /forum/torrentbar/torrentbar.php?id=$1&style=$2 break;
>>        rewrite
>> ^/forum/torrentbar/(.*)/([0123456789]*)-([0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_]*)\.png$
>> /forum/torrentbar/torrentbar.php?id=$2&style=$3 break;
>>    }
>>
>> в логах:
>> 2008/05/16 16:48:01 [error] 8779#0: *15237 open()
>> "/home/sites/site.by/www/forum/torrentbar/3-default_cyan.png" failed
>> (2: No such file or directory), client: 1.2.22.22, server: site.by,
>> URL: "/forum/torrentbar/3-default_cyan.png", host: "site.by"
>> в браузере просто белая пустая страница
>>
>> --
>> Denis Kot
>> denis?jabber.org.by
>> ICQ: 13680126
>> Mobil: +375 29 6-1234-78
>>
> 
> 
> 





More information about the nginx-ru mailing list