I need some urgent rewrites

Aleksandar Lazic al-nginx at none.at
Sat Mar 21 23:01:52 UTC 2015


Hi.

Only syntax checked.

Please read for further investigation.

http://nginx.org/en/docs/varindex.html
http://nginx.org/r/location
http://nginx.org/r/return
https://regex101.com/

Am 21-03-2015 16:57, schrieb Milos:
> I need some urgent rewrites
> 
> From:
> http://www.my-domain.de/kalorientabelle.php/unterkategorie/204-suppen
> To:
> http://www.my-domain.de/kalorientabelle/suppen.204/unterkategorie

[snip]

This should work for all your examples.

location ~ (\w+).php\/(\w+)\/(\d+)-([\w-]+) {
   return 302 $scheme://$hostname/$1/$4.$3/$2;
}

> I would be very happy if someone can help me.

BR Aleks

> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,257523,257523#msg-257523
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list