Forum: NGINX 谁能帮我改写一下rewrite?

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.
2dac4384238ef183a10fadf10ed6968c?d=identicon&s=25 Big Bet (bigbet)
on 2009-05-18 06:32
RewriteEngine On
Options +Followsymlinks
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.* - [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*/images/(.*)$ /images/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*/uploads_user/(.*)$ /uploads_user/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ /profile.php?user=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/([^/]+)?$ /profile.php?user=$1$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/albums/([0-9]+)/([0-9]+)/?$
/album_file.php?user=$1&album_id=$2&media_id=$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/albums/([0-9]+)/?$ /album.php?user=$1&album_id=$2
[L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/albums/([0-9]+)/([^/]+)?$
/album.php?user=$1&album_id=$2$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/albums/?$ /albums.php?user=$1 [L]






RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/listings/([0-9]+)/?$
/listing.php?user=$1&listing_id=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/listings/voted/([^/]+)?$
/listings_voted.php?user=$1$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/listings/([0-9]+)/vote?$
/listing.php?user=$1&listing_id=$2&task=vote$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/listings/([0-9]+)/removevote?$
/listing.php?user=$1&listing_id=$2&task=removevote$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/listings/([0-9]+)/([^/]+)?$
/listing.php?user=$1&listing_id=$2$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/listings/?$ /listings.php?user=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^listings/tag/([^/]+)/?$ /browse_listings.php?tag=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^listings/category/([0-9]+)/?$
/browse_listings.php?cat_id=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/articles/([^/]+)?$ /articles.php?user=$1$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/articles/?$ /articles.php?user=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^article/([0-9]+)(/[^/]*)?$
/article.php?article_id=$1&article_slug=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/polls/([0-9]+)/?$ /poll.php?user=$1&poll_id=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/polls/([0-9]+)/([^/]+)?$
/poll.php?user=$1&poll_id=$2$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/polls/?$ /polls.php?user=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^page/([^/]*)?$ /content.php?page=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/classifieds/([0-9]+)/?$
/classified.php?user=$1&classified_id=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/classifieds/([0-9]+)/([^/]+)?$
/classified.php?user=$1&classified_id=$2$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/classifieds/?$ /classifieds.php?user=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/bulletin/([0-9]+)/?$
/bulletin_entry.php?user=$1&bulletinentry_id=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/bulletin/([^/]+)?$ /bulletin.php?user=$1$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/bulletin/?$ /bulletin.php?user=$1 [L]




RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/)?event/([0-9]+)/([^/]*)$ /event.php?event_id=$1$2$3
[L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/)?event/([0-9]+)/album/([0-9]+)/([^/]*)$
/event_album_file.php?event_id=$2&eventmedia_id=$3$4 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/)?group/([0-9]+)/([^/]*)$ /group.php?group_id=$1$2$3
[L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/)?group/([0-9]+)/album/([0-9]+)/([^/]*)$
/group_album_file.php?group_id=$2&groupmedia_id=$3$4 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/)?group/([0-9]+)/discussion/([0-9]+)/([^/]*)$
/group_discussion_view.php?group_id=$2&grouptopic_id=$3$4 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/)?group/([0-9]+)/discussion/([0-9]+)/([0-9]+)/([^/]*)$
/group_discussion_view.php?group_id=$2&grouptopic_id=$3&grouppost_id=$4$5
[L]


RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/blog/([0-9]+)/?$ /blog.php?user=$1&blogentry_id=$2
[L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/blog/([^/]+)?$ /blog.php?user=$1$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/blog/?$ /blog.php?user=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/trackback/([0-9]+)/?$
/blog_ajax.php?task=trackback&user=$1&blogentry_id=$2 [L]




RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^application/([0-9]+)/?$ /app.php?id=$1 [L]
3cddf7e69326b8aad9c8e848344252a5?d=identicon&s=25 bb123bb10 (Guest)
on 2009-05-18 07:23
(Received via mailing list)
try this~
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/

----- Original Message -----
From: "Big Bet" <lists@ruby-forum.com>
To: <nginx@sysoev.ru>
Sent: Monday, May 18, 2009 12:32 PM
Subject: 谁能帮我改写一下rewrite?
This topic is locked and can not be replied to.