今天有个朋友需要弄App下载站 用的是应用加程序(YYjia),放linux下跑nginx规则居然连官方都没用。。。。。只有httpd.ini,算了自己转吧,转换后规则如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #新加 rewrite ^([^\.]*)/(apple|android|wphone)/(down)/([0-9]+?)_([0-9]+?)\.(htm|html|shtml) $1/$2.php?ac=$3&id=$4&k=$5 last; rewrite ^([^\.]*)/(apple|android|wphone)/(down)/([0-9]+?)\.(htm|html|shtml) $1/$2.php?ac=$3&id=$4 last; rewrite ^([^\.]*)/(contact)/(copyright|upload|address|comment)\.(htm|html|shtml) $1/index.php?ac=$2&op=$3 last; rewrite ^([^\.]*)/(contact)/ $1/index.php?ac=$2 last; #android rewrite ^([^\.]*)/(android)/(search)/(.*)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml) $1/android.php?ac=$3&keyword=$4&orderby=$5&page=$6 last; rewrite ^([^\.]*)/(android)/(search)/(.*)/ $1/android.php?ac=$3&type=$2&keyword=$4 last; rewrite ^([^\.]*)/(android)/(subdetail)/([0-9]+?)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml) $1/android.php?ac=$3&subjectid=$4&orderby=$5&page=$6 last; rewrite ^([^\.]*)/(android)/(subdetail)/([0-9]+?)/ $1/android.php?ac=$3&subjectid=$4 last; rewrite ^([^\.]*)/(android)/(subdetail)/([a-zA-Z0-9]+?)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml) $1/android.php?ac=$3&sname=$4&orderby=$5&page=$6 last; rewrite ^([^\.]*)/(android)/(subdetail)/([a-zA-Z0-9]+?)/ $1/android.php?ac=$3&sname=$4 last; rewrite ^([^\.]*)/(android)/(game|soft)/(list)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml) $1/android.php?ac=applists&lx=$3&orderby=$5&page=$6 last; rewrite ^([^\.]*)/(android)/(game|soft)/(list)/([a-zA-Z]+?).(htm|html|shtml) $1/android.php?ac=applists&lx=$3&orderby=$5 last; rewrite ^([^\.]*)/(android)/(game|soft)/(list)/ $1/android.php?ac=applists&lx=$3 last; rewrite ^([^\.]*)/(android)/(news)/([a-zA-Z0-9]+?)/([0-9]+?).(htm|html|shtml) $1/android.php?ac=newdetail&cname=$4&newid=$5 last; rewrite ^([^\.]*)/(android)/(recommend)/(game|soft)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml) $1/android.php?ac=$3&typelx=$4&orderby=$5&page=$6 last; rewrite ^([^\.]*)/(android)/(recommend)/(game|soft)/([a-zA-Z]+?).(htm|html|shtml) $1/android.php?ac=$3&typelx=$4&orderby=$5 last; rewrite ^([^\.]*)/(android)/(recommend)/(game|soft)/ $1/android.php?ac=$3&type=$2&typelx=$4 last; rewrite ^([^\.]*)/(android)/(recommend|news)/([a-zA-Z0-9]+?)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml) $1/android.php?ac=$3&cname=$4&orderby=$5&page=$6 last; rewrite ^([^\.]*)/(android)/(recommend)/([a-zA-Z0-9]+?)/([a-zA-Z]+?).(htm|html|shtml) $1/android.php?ac=$3&cname=$4&orderby=$5 last; rewrite ^([^\.]*)/(android)/(recommend|news)/([a-zA-Z0-9]+?)/ $1/android.php?ac=$3&cname=$4 last; rewrite ^([^\.]*)/(android)/(recommend|subject|news)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml) $1/android.php?ac=$3&orderby=$4&page=$5 last; rewrite ^([^\.]*)/(android)/(recommend)/([a-zA-Z]+?).(htm|html|shtml) $1/android.php?ac=$3&orderby=$4 last; rewrite ^([^\.]*)/(android)/(subject|news|recommend|game|soft)/ $1/android.php?ac=$3 last; rewrite ^([^\.]*)/(android)/([a-zA-Z0-9]+?)/([0-9]+?)_p([0-9]+?)\.(htm|html|shtml) $1/android.php?ac=detail&cname=$3&id=$4&page=$5 last; rewrite ^([^\.]*)/(android)/([a-zA-Z0-9]+?)/([0-9]+?)\.(htm|html|shtml) $1/android.php?ac=detail&cname=$3&id=$4 last; rewrite ^([^\.]*)/(android)/([a-zA-Z0-9]+?)/([a-zA-Z]+?)_([0-9]+?).(htm|html|shtml) $1/android.php?ac=applists&cname=$3&orderby=$4&page=$5 last; rewrite ^([^\.]*)/(android)/([a-zA-Z0-9]+?)/([a-zA-Z]+?).(htm|html|shtml) $1/android.php?ac=applists&cname=$3&orderby=$4 last; rewrite ^([^\.]*)/(android)/([a-zA-Z0-9]+?)/ $1/android.php?ac=applists&cname=$3 last; rewrite ^([^\.]*)/(android)/ $1/android.php last; #新加 rewrite ^([^\.]*)/(alllist)/(newsoft|newgame|recomgame|recomsoft)/index_([0-9]+?)\.(htm|html|shtml) $1/index.php?ac=$2&op=$3&page=$4 last; rewrite ^([^\.]*)/(alllist)/(newsoft|newgame|recomgame|recomsoft)/ $1/index.php?ac=$2&op=$3 last; rewrite ^([^\.]*)/(rss)\.(htm|html|shtml) $1/index.php?ac=$2 last; rewrite ^([^\.]*)/(sitemap)_(app|news)/index_([0-9]+?)\.(htm|html|shtml) $1/index.php?ac=$2&op=$3&page=$4 last; rewrite ^([^\.]*)/(sitemap)_(app|news)/ $1/index.php?ac=$2&op=$3 last; |
2015-8-31更新新版本 上面用不的用下面的哦
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #新加 rewrite "^/(apple|android|wphone)/(down)/([0-9]+?)_([0-9]+?)\.(htm|html|shtml)" /$1.php?ac=$2&id=$3&k=$4 last; rewrite "^/(apple|android|wphone)/(down)/([0-9]+?)\.(htm|html|shtml)" /$1.php?ac=$2&id=$3 last; rewrite "^/(iphone|ipad)/" /apple.php?type=$1 last; #android rewrite "^/(android)/(search)/(.*)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml)" /android.php?ac=$2&keyword=$3&orderby=$4&page=$5 last; rewrite "^/(android)/(search)/(.*)/" /android.php?ac=$2&type=$1&keyword=$3 last; rewrite "^/(android)/(subdetail)/([0-9]+?)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml)" /android.php?ac=$2&subjectid=$3&orderby=$4&page=$5 last; rewrite "^/(android)/(subdetail)/([0-9]+?)/" /android.php?ac=$2&subjectid=$3 last; rewrite "^/(android)/(subdetail)/([a-zA-Z0-9]+?)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml)" /android.php?ac=$2&sname=$3&orderby=$4&page=$5 last; rewrite "^/(android)/(subdetail)/([a-zA-Z0-9]+?)/" /android.php?ac=$2&sname=$3 last; rewrite "^/(android)/(game|soft)/(list)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml)" /android.php?ac=applists&lx=$2&orderby=$4&page=$5 last; rewrite "^/(android)/(game|soft)/(list)/([a-zA-Z]+?).(htm|html|shtml)" /android.php?ac=applists&lx=$2&orderby=$4 last; rewrite "^/(android)/(game|soft)/(list)/" /android.php?ac=applists&lx=$2 last; rewrite "^/(android)/(news)/([a-zA-Z0-9]+?)/([0-9]+?).(htm|html|shtml)" /android.php?ac=newdetail&cname=$3&newid=$4 last; rewrite "^/(android)/(recommend)/(game|soft)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml)" /android.php?ac=$2&typelx=$3&orderby=$4&page=$5 last; rewrite "^/(android)/(recommend)/(game|soft)/([a-zA-Z]+?).(htm|html|shtml)" /android.php?ac=$2&typelx=$3&orderby=$4 last; rewrite "^/(android)/(recommend)/(game|soft)/" /android.php?ac=$2&type=$1&typelx=$3 last; rewrite "^/(android)/(recommend|news)/([a-zA-Z0-9]+?)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml)" /android.php?ac=$2&cname=$3&orderby=$4&page=$5 last; rewrite "^/(android)/(recommend)/([a-zA-Z0-9]+?)/([a-zA-Z]+?).(htm|html|shtml)" /android.php?ac=$2&cname=$3&orderby=$4 last; rewrite "^/(android)/(recommend|news)/([a-zA-Z0-9]+?)/" /android.php?ac=$2&cname=$3 last; rewrite "^/(android)/(recommend|subject|news)/([a-zA-Z]+?)\_([0-9]+?).(htm|html|shtml)" /android.php?ac=$2&orderby=$3&page=$4 last; rewrite "^/(android)/(recommend)/([a-zA-Z]+?).(htm|html|shtml)" /android.php?ac=$2&orderby=$3 last; rewrite "^/(android)/(subject|news|recommend|game|soft)/" /android.php?ac=$2 last; rewrite "^/(android)/([a-zA-Z0-9]+?)/([0-9]+?)_p([0-9]+?)\.(htm|html|shtml)" /android.php?ac=detail&cname=$2&id=$3&page=$4 last; rewrite "^/(android)/([a-zA-Z0-9]+?)/([0-9]+?)\.(htm|html|shtml)" /android.php?ac=detail&cname=$2&id=$3 last; rewrite "^/(android)/([a-zA-Z0-9]+?)/([a-zA-Z]+?)_([0-9]+?).(htm|html|shtml)" /android.php?ac=applists&cname=$2&orderby=$3&page=$4 last; rewrite "^/(android)/([a-zA-Z0-9]+?)/([a-zA-Z]+?).(htm|html|shtml)" /android.php?ac=applists&cname=$2&orderby=$3 last; rewrite "^/(android)/([a-zA-Z0-9]+?)/" /android.php?ac=applists&cname=$2 last; rewrite "^/(android)/" /android.php last; #新加 rewrite "^/(alllist)/(newsoft|newgame|recomgame|recomsoft)/index_([0-9]+?)\.(htm|html|shtml)" /index.php?ac=$1&op=$2&page=$3 last; rewrite "^/(alllist)/(newsoft|newgame|recomgame|recomsoft)/" /index.php?ac=$1&op=$2 last; rewrite "^/(contact)/(copyright|upload|comment|address)\.(htm|html|shtml)" /index.php?ac=$1&op=$2 last; rewrite "^/(contact)/" /index.php?ac=$1 last; #新加20131018 rewrite "^/(rss).(htm|html|shtml)" /index.php?ac=$1 last; rewrite "^/(sitemap)_(app|news)/index_([0-9]+?)\.(htm|html|shtml)" /index.php?ac=$1&op=$2&page=$3 last; rewrite "^/(sitemap)_(app|news)/" /index.php?ac=$1&op=$2 last; rewrite "^/(mobile)/(.*)\.(htm|html|shtml)" /mobile.php?rewrite=$2 last; |