Re: 谁能帮我改写一下rewrite?

bb123bb10 bb123bb10 at sina.com.cn
Mon May 18 09:15:55 MSD 2009


try this~
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/

----- Original Message ----- 
From: "Big Bet" <lists at ruby-forum.com>
To: <nginx at sysoev.ru>
Sent: Monday, May 18, 2009 12:32 PM
Subject: 谁能帮我改写一下rewrite?


> 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]
> -- 
> Posted via http://www.ruby-forum.com/.
> 
>


More information about the nginx mailing list