Forum: NGINX Looking for rewrite rules

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 Crazy-Achmet (Guest)
on 2009-05-07 15:09
(Received via mailing list)
Hey,

i'm new to NGINX and this community so i hope this is the right place to
post my question.

I have this .htaccess which is working perfect on my apache:


Options +FollowSymlinks
RewriteEngine On
RewriteRule ^(+)/robots\.txt$ robots.txt
RewriteRule ^members/page([0-9]+).html$ index.php?page=$1
RewriteRule ^whatsnew/entries/([0-9]+)/page([0-9]+).html$
browsecategory.php?do=newentries&cutoffdate=$1&page=$2
RewriteRule ^whatsnew/entries/(([0-9]?|-)+/?)$
browsecategory.php?do=newentries&cutoffdate=$1
RewriteRule ^whatsnew/posts/([0-9]+)/page([0-9]+).html$
browsecategory.php?do=newposts&cutoffdate=$1&page=$2
RewriteRule ^whatsnew/posts/(([0-9]?|-)+/?)$
browsecategory.php?do=newposts&cutoffdate=$1
RewriteRule ^whatspopular/(+)/$
browsecategory.php?do=popentries&orderby=$1
RewriteRule ^members/(+)/page([0-9]+).html$
browsecategory.php?do=member&userrewrite=$1&page=$2
RewriteRule ^members/((|-)+/?)$
browsecategory.php?do=member&userrewrite=$1
RewriteRule ^(+)/members/(+)/page([0-9]+).html$
browsecategory.php?userrewrite=$2&catrewrite=$1&page=$3
RewriteRule ^(+)/members/((|-)+/?)$
browsecategory.php?userrewrite=$2&catrewrite=$1
RewriteRule ^(+)/((|-)+)/$ showentry.php?entryrewrite=$2&catrewrite=$1
RewriteRule ^(+)/(+)/page([0-9]+).html$
showentry.php?entryrewrite=$2&catrewrite=$1&page=$3
RewriteRule ^(+)/(+)/epage([0-9]+).html$
showentry.php?entryrewrite=$2&catrewrite=$1&epage=$3
RewriteRule ^(+)/page([0-9]+).html$
browsecategory.php?catrewrite=$1&page=$2
RewriteRule ^(+)/?$ browsecategory.php?catrewrite=$1


My question is, whats the right syntax for NGINX. I was playing around a
little bit but i couldn't get it to work.

Could you help me please?! ;) Thanks in advance

Greetings from Germany

Florian

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,1853,1853#msg-1853
2974d09ac2541e892966b762aad84943?d=identicon&s=25 TommyGFX (Guest)
on 2009-05-07 21:03
(Received via mailing list)
Hallo,



location / {
    rewrite ^(+)/robots\.txt$ robots.txt last;
    rewrite ^members/page([0-9]+).html$ index.php?page=$1 last;
    rewrite ^whatsnew/entries/([0-9]+)/page([0-9]+).html$
browsecategory.php?do=newentries&cutoffdate=$1&page=$2 last;
    rewrite ^whatsnew/entries/(([0-9]?|-)+/?)$
browsecategory.php?do=newentries&cutoffdate=$1 last;
    rewrite ^whatsnew/posts/([0-9]+)/page([0-9]+).html$
browsecategory.php?do=newposts&cutoffdate=$1&page=$2 last;
    rewrite ^whatsnew/posts/(([0-9]?|-)+/?)$
browsecategory.php?do=newposts&cutoffdate=$1 last;
    rewrite ^whatspopular/(+)/$
browsecategory.php?do=popentries&orderby=$1 last;
    rewrite ^members/(+)/page([0-9]+).html$
browsecategory.php?do=member&userrewrite=$1&page=$2 last;
    rewrite ^members/((|-)+/?)$
browsecategory.php?do=member&userrewrite=$1 last;
    rewrite ^(+)/members/(+)/page([0-9]+).html$
browsecategory.php?userrewrite=$2&catrewrite=$1&page=$3 last;
    rewrite ^(+)/members/((|-)+/?)$
browsecategory.php?userrewrite=$2&catrewrite=$1 last;
    rewrite ^(+)/((|-)+)/$ showentry.php?entryrewrite=$2&catrewrite=$1
last;
    rewrite ^(+)/(+)/page([0-9]+).html$
showentry.php?entryrewrite=$2&catrewrite=$1&page=$3 last;
    rewrite ^(+)/(+)/epage([0-9]+).html$
showentry.php?entryrewrite=$2&catrewrite=$1&epage=$3 last;
    rewrite ^(+)/page([0-9]+).html$
browsecategory.php?catrewrite=$1&page=$2 last;
    rewrite ^(+)/?$ browsecategory.php?catrewrite=$1 last;
}




Das Sollte funktionieren wenn nicht mal fehler meldung.

Kommt in die config vom nginx

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,1853,1861#msg-1861
2974d09ac2541e892966b762aad84943?d=identicon&s=25 Crazy-Achmet (Guest)
on 2009-05-07 23:26
(Received via mailing list)
Danke für deine Hilfe! Bekomme leider immer den Fehler "No input file
specified."

Hmmm

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,1853,1864#msg-1864
Abbd9d5312c5d54114a96a35dc94fdb1?d=identicon&s=25 Valery Kholodkov (Guest)
on 2009-05-08 14:40
(Received via mailing list)
Weiss nicht ob es korrekt ist, schaut aber beeindruckend. Vielleicht es
ist eine gute Idee einen automatischen Ãœbersetzer zu erstellen.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 TommyGFX (Guest)
on 2009-05-08 15:46
(Received via mailing list)
Das hört sich gut an :)

das währe praktisch.

aber wenn man einmal drin ist ist es eigentlich das gleiche wie
mod_rewrite vom apache nur am anfang anders und am ende

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,1853,1863#msg-1863
2974d09ac2541e892966b762aad84943?d=identicon&s=25 mow (Guest)
on 2009-05-08 16:34
(Received via mailing list)
This topic is locked and can not be replied to.