太虚伪了 发表于 2014-6-3 10:42:39

apache和nginx的rewrite转换问题

以前apache的.htaccess文件RewriteEngine on

RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* -

RewriteCond %{HTTP_HOST} !^www.ewdai.com$

RewriteRule ^(.*)$ http://www.ewdai.com/$1

SetOutputFilter DEFLATE

AddOutputFilterByType DEFLATE text/html text/css image/gif image/jpeg image/png application/x-javascript

php_value memory_limit 512M
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_value docref_root 0
php_value docref_ext 0

RewriteRule .(php.|php3.) index.php
RewriteRule update/$ –
RewriteRule data/$ –
RewriteRule themes/$ –
RewriteRule update/(.*).php$ –
RewriteRule data/(.*).php$ –
RewriteRule themes/(.*).php$ –

RewriteRule (.*)/index.html$ index.php?$1
RewriteRule (.*)/index(\d+).html$ index.php?$1&page=$2
RewriteRule (.*)/a(\d+)\.html$ index.php?$1/$2
RewriteRule ^u/(\d+)/(.*)$ index.php?u&$1&$2
RewriteRule ^u/(\d+)/(.*)/$ index.php?u&$1&$2
RewriteRule ^u/(\d+)$ index.php?u&$1
RewriteRule ^u/(\d+)/$ index.php?u&$1
RewriteRule (.*)/index.html\?(.*) index.php?$1&$2
RewriteRule (.*)/index(\d+).html\?(.*) index.php?$1&page=$2&$2
现在换成了NGNIX以后rewrite该怎么写,有知道的朋友帮下忙,谢谢了

licess 发表于 2014-6-3 15:10:34

http://blog.licess.com/convert-apache-htaccess-to-nginx/
页: [1]
查看完整版本: apache和nginx的rewrite转换问题