redirect from www to sub-page

Marcin Kasperski Marcin.Kasperski at mekk.waw.pl
Thu Jan 22 23:59:43 MSK 2009


>      rewrite ^/$ /new_location;
>
> will run regex "^/$" for every request, while
>
>      location = / {
>          rewrite ^   http://www.example.com/new_location;
>
> is just simple comparison with "/". And the regex "^" will be run only
> for "/" requests.

Thanks for the explanation.

PS It could be interesting to measure how noticeable the difference
is. Precompiled hooked regexps aren't that slow.... But I don't have
an idea of realistic benchmark.


-- 
----------------------------------------------------------------------
| Marcin Kasperski   |  Users typically do not know exactly what
| http://mekk.waw.pl | they want and are unable to articulate all
|                    |          that they know. (Parnas)
----------------------------------------------------------------------






More information about the nginx mailing list