VPS侦探论坛

 找回密码
 注册
查看: 5721|回复: 1

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

[复制链接]
发表于 2011-10-13 18:28:46 | 显示全部楼层 |阅读模式

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

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)/(zsj|sqk|company)/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.*)/$ $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-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay.php?fid=$2&page=$3
# RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.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 ^(.*)/([a-z]+)/([a-z]+)([0-9]+)/$ $1/$2/$3.php?uid=$4
RewriteRule ^(.*)/(sjs|yz|zs|sj)/([0-9]+)/?$ $1/$2/index.php?uid=$3
RewriteRule ^(.*)/([a-z]+)/([0-9]+)/([0-9]*)([a-z]+)([0-9]?)-([0-9a-z]+)-([0-9]+).html$ $1/$2/$5.php?uid=$3&act=$7&gate=$4&exe=$6&page=$8
RewriteRule ^(.*)/([a-z]+)/([0-9]+)/([a-z]+)-display-([a-z]+)([0-9]+).html$ $1/$2/$4.php?uid=$3&act=display&$5id=$6
RewriteRule ^(.*)/([a-z]+)/([a-z_]+)-([0-9]+)(s([0-9]+))?(i([0-9]+))?p?([0-9]+)?$ $1/$2/$3.php?btype=$4&stype=$6&id=$8&page=$9
# RewriteRule ^(.*)/(case)/(c)(([0-9]?)([0-9]?)([0-9]?)[0-9]*).html$ $1/cache/$3/$5/$6/$7/$4.htm
#RewriteRule ^(.*)/([a-z]+)/(a|m)(([0-9]?)([0-9]?)([0-9]?)[0-9]*).html$ $1/cache/$3/$5/$6/$7/$4.htm
RewriteRule ^(.*)/([a-z]+)/([a-z_]+)([0-9]+)-?([0-9]+)?.html$ $1/$2/$3.php?id=$4&page=$5
RewriteRule ^(.*)/([a-z]+)/([a-z_]+)([0-9]+)h.html$ $1/html/$2/$3$4h.html
RewriteRule ^(.*)/([a-z]+)/([a-z_]+)-h([0-9]+)(s([0-9]+))?(i([0-9]+))?$ $1/html/$2/$3-h$4$5$7.html
RewriteRule ^(.*)/zt([0-9]+)/$ $1/zt/topic.php?zid=$2
RewriteRule ^(.*)/zt([0-9]+)/([a-z_]+)([0-9]+).html$ $1/zt/$3.php?zid=$2&type=$4
</IfModule>
           

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


   <IfModule mod_rewrite.c>
RewriteEngine On
#RewriteRule ^([url=http://)/?(www\.)?([a-zA-Z]+)\.shzhutng\.com/company/(.*)$]http://)?(www\.)?([a-zA-Z]+)\.shzhutng\.com/company/(.*)$[/url] http://www.shzhutong.com/company/index.php?city=$3
#RewriteRule ^(.*)$ /go.php
RewriteRule ^(.*)/([a-z]+)/([a-z_]+)([0-9]+)-?([0-9]+)?.html$ $1/$2/$3.php?id=$4&page=$5
RewriteRule ^(.*)/zb/$ $1/zb/index.php
RewriteRule ^(.*)/(zsj|sqk|company)/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.*)/$ $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 ^(.*)/([a-z]+)/([a-z]+)([0-9]+)/$ $1/$2/$3.php?uid=$4
RewriteRule ^(.*)/(sjs|yz|zs|sj)/([0-9]+)/?$ $1/$2/index.php?uid=$3
RewriteRule ^(.*)/([a-z]+)/([0-9]+)/([0-9]*)([a-z]+)([0-9]?)-([0-9a-z]+)-([0-9]+).html$ $1/$2/$5.php?uid=$3&act=$7&gate=$4&exe=$6&page=$8
RewriteRule ^(.*)/([a-z]+)/([0-9]+)/([a-z]+)-display-([a-z]+)([0-9]+).html$ $1/$2/$4.php?uid=$3&act=display&$5id=$6
RewriteRule ^(.*)/([a-z]+)/([a-z_]+)-([0-9]+)(s([0-9]+))?(i([0-9]+))?p?([0-9]+)?$ $1/$2/$3.php?btype=$4&stype=$6&id=$8&page=$9
</IfModule>
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-10-13 19:04:04 | 显示全部楼层


怎么都这么复杂的啊。。只能自己再写一遍。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-21 12:40 , Processed in 0.043845 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表