Nginx Rewrite Apache?

Steve steeeeeveee at gmx.net
Tue Apr 12 01:36:55 MSD 2011


-------- Original-Nachricht --------
> Datum: Mon, 11 Apr 2011 17:19:23 -0400
> Von: "Adrian Janeczek" <nginx-forum at nginx.us>
> An: nginx at nginx.org
> Betreff: Nginx Rewrite Apache?

> Hi
> I have problem with rewrite from apache
> RewriteEngine On 
> 
> RewriteRule
> ^[A-Z]{3}[a-z]{2}[0-9]{4}[a-z]{3}[0-9]{4}[A-Z]{2}[a-z]{1}[0-9]{1}/(.+)$
> files/$1
> 
> rewrite
> ^[A-Z]{3}[a-z]{2}[0-9]{4}[a-z]{3}[0-9]{4}[A-Z]{2}[a-z]{1}[0-9]{1}/(.+)$
> /files/$1 last;
> This rule dosent work... 
> Problem is { }
>
So why don't you rewrite that regexp to not use {}?
rewrite "^/[A-Z][A-Z][A-Z][a-z][a-z][0-9][0-9][0-9][0-9][a-z][a-z][a-z][0-9][0-9][0-9][0-9][A-Z][A-Z][a-z][0-9]/(.+)$" /files/$1 last;

If you ask me, your original regexp should be enclosed in quotes:
rewrite "^/[A-Z]{3}[a-z]{2}[0-9]{4}[a-z]{3}[0-9]{4}[A-Z]{2}[a-z][0-9]/(.+)$ /files/$1 last;

Btw: using "[0-9]{1}" is equal to "[0-9]"


> On apache this work 
> http://xx.xx.xx/QJNqq0821sxz7200DAp0/Si.s_sred.iowi.cze.part5.rar
> rewriting to
> to http://xx.xx.xx/files/Si.s_sred.iowi.cze.part5.rar but 
> http://xx.xx.xx/dsadasdaddsads/Si.s_sred.iowi.cze.part5.rar  musnt not
> work
> 
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,190307,190307#msg-190307
> 
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx

-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!			
Jetzt informieren: http://www.gmx.net/de/go/freephone



More information about the nginx mailing list