Excellent, it worked
I have another urgent matter on a server live we just switched to
I need that links like this:
http://www.example.com/?v=JYH253CT
to be rewritten as http://www.example.com/v.php?dl=JYH253CT
Please help, server is down :(
---------------------------------------------------------------
Cristian Rusu
Web Developement & Electronic Publishing
======
Crilance.com
Crilance.blogspot.com
On Wed, Nov 28, 2012 at 10:30 AM, Maxim Dounin <mdounin@mdounin.ru> wrote:
> Hello!
>
> On Wed, Nov 28, 2012 at 10:04:58AM +0200, Cristian Rusu wrote:
>
> > Hello
> >
> > I have urls like example.com/123
> > I need them rewritten to example.com/?v=123
> >
> > However, I want to skip certain directories from rewrite
> > eg.
> > example.com/status
> > example.com/admin
> >
> > right now I have this:
> >
> > if (!-e $request_filename){
> > rewrite ^/([A-Za-z0-9-]+)/?$
> http://www.example.com/v.php?dl=$1redirect;
> > }
> >
> > Problem is that all urls are rewritten.. how do I put some exceptions?
>
> I would recommend using location matching to differentiate URIs
> which should be handled differently. E.g.
>
> location / {
> # you may want to use try_files here instead
> if (...) {
> rewrite ...
> }
> ...
> }
>
> location /status {
> ...
> }
>
> location /admin {
> ...
> }
>
> See http://nginx.org/r/location for more information.
>
> --
> Maxim Dounin
> http://nginx.com/support.html
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx