jmxye 发表于 2011-10-13 18:28:46

怎么将apache下的规则转换为nginx下的,麻烦帮忙看看怎么弄,有点多,自己弄了很长时间也没弄好,实在没办法了帮忙

怎么将apache下的规则转换为nginx下的,麻烦帮忙看看怎么弄,有点多,自己弄了很长时间也没弄好,实在没办法了帮忙

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)/(zsj|sqk|company)/(+)-(+)-(+)-(+)-(+)-(+)-(.*)/$ $1/$2/index.php?orderid=$3&a2=$4&a3=$5&a4=$6&a5=$7&a6=$8&a7=$9
#RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)$ $1/archiver/index.php?$2
# RewriteRule ^(.*)/forum-(+)-(+)\.html$ $1/forumdisplay.php?fid=$2&page=$3
# RewriteRule ^(.*)/thread-(+)-(+)-(+)\.html$ $1/viewthread.php?tid=$2&extra=page\%3D$4&page=$3
# RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/space.php?$2=$3
# RewriteRule ^(.*)/tag-(.+)\.html$ $1/tag.php?name=$2
RewriteRule ^(.*)/bbs/images/(.*) $1/bbs/images/$2
RewriteRule ^(.*)/bbs/(.*) http://bbs.shzhutong.com/$2
RewriteRule ^(.*)/(+)/(+)(+)/$ $1/$2/$3.php?uid=$4
RewriteRule ^(.*)/(sjs|yz|zs|sj)/(+)/?$ $1/$2/index.php?uid=$3
RewriteRule ^(.*)/(+)/(+)/(*)(+)(?)-(+)-(+).html$ $1/$2/$5.php?uid=$3&act=$7&gate=$4&exe=$6&page=$8
RewriteRule ^(.*)/(+)/(+)/(+)-display-(+)(+).html$ $1/$2/$4.php?uid=$3&act=display&$5id=$6
RewriteRule ^(.*)/(+)/(+)-(+)(s(+))?(i(+))?p?(+)?$ $1/$2/$3.php?btype=$4&stype=$6&id=$8&page=$9
# RewriteRule ^(.*)/(case)/(c)((?)(?)(?)*).html$ $1/cache/$3/$5/$6/$7/$4.htm
#RewriteRule ^(.*)/(+)/(a|m)((?)(?)(?)*).html$ $1/cache/$3/$5/$6/$7/$4.htm
RewriteRule ^(.*)/(+)/(+)(+)-?(+)?.html$ $1/$2/$3.php?id=$4&page=$5
RewriteRule ^(.*)/(+)/(+)(+)h.html$ $1/html/$2/$3$4h.html
RewriteRule ^(.*)/(+)/(+)-h(+)(s(+))?(i(+))?$ $1/html/$2/$3-h$4$5$7.html
RewriteRule ^(.*)/zt(+)/$ $1/zt/topic.php?zid=$2
RewriteRule ^(.*)/zt(+)/(+)(+).html$ $1/zt/$3.php?zid=$2&type=$4
</IfModule>
         

----------------------------------------------------------------
另一个


   <IfModule mod_rewrite.c>
RewriteEngine On
#RewriteRule ^(+)\.shzhutng\.com/company/(.*)$]http://)?(www\.)?(+)\.shzhutng\.com/company/(.*)$ http://www.shzhutong.com/company/index.php?city=$3
#RewriteRule ^(.*)$ /go.php
RewriteRule ^(.*)/(+)/(+)(+)-?(+)?.html$ $1/$2/$3.php?id=$4&page=$5
RewriteRule ^(.*)/zb/$ $1/zb/index.php
RewriteRule ^(.*)/(zsj|sqk|company)/(+)-(+)-(+)-(+)-(+)-(+)-(.*)/$ $1/$2/index.php?orderid=$3&a2=$4&a3=$5&a4=$6&a5=$7&a6=$8&a7=$9
RewriteRule ^(.*)/sqk/$ $1/sqk/index.php
RewriteRule ^(.*)/company/$ $1/company/index.php
#RewriteRule ^(.*)$ /go.php
RewriteRule ^(.*)/(+)/(+)(+)/$ $1/$2/$3.php?uid=$4
RewriteRule ^(.*)/(sjs|yz|zs|sj)/(+)/?$ $1/$2/index.php?uid=$3
RewriteRule ^(.*)/(+)/(+)/(*)(+)(?)-(+)-(+).html$ $1/$2/$5.php?uid=$3&act=$7&gate=$4&exe=$6&page=$8
RewriteRule ^(.*)/(+)/(+)/(+)-display-(+)(+).html$ $1/$2/$4.php?uid=$3&act=display&$5id=$6
RewriteRule ^(.*)/(+)/(+)-(+)(s(+))?(i(+))?p?(+)?$ $1/$2/$3.php?btype=$4&stype=$6&id=$8&page=$9
</IfModule>

yuweitaocn 发表于 2011-10-13 19:04:04

怎么都这么复杂的啊。。只能自己再写一遍。
页: [1]
查看完整版本: 怎么将apache下的规则转换为nginx下的,麻烦帮忙看看怎么弄,有点多,自己弄了很长时间也没弄好,实在没办法了帮忙