rewrite

Igor Sysoev is at rambler-co.ru
Mon Dec 1 11:19:33 MSK 2008


On Mon, Dec 01, 2008 at 11:04:37AM +0300, aris aris wrote:

> Подскажите, пожалуйста, правило rewrite. Чтобы все, кроме форматов |jpg|gif|jpeg|png|html| и ссылок без указания формата, к примеру, http://site.ru/site/567eik82049m876eutrakc4312   переадресовывалось на index.php. Nginx 6.32

location / {
    rewrite  ^  /index.php;
}

location = /index.php {
   ...
}

location ~ \.(jpg|gif|jpeg|png|html)$ {
   ...
}

location ~ /[^\.]+$ {
   ...
}


-- 
Игорь Сысоев
http://sysoev.ru





More information about the nginx-ru mailing list