全球主机交流论坛

标题: 求小偷伪静态规则 [打印本页]

作者: 我是小白    时间: 2010-12-19 21:06
标题: 求小偷伪静态规则
.htaccess 的如下:

RewriteEngine on
RewriteRule  ^index.html$  index.php$1
RewriteRule  ^book/([0-9]+).html$  book.php?id=$1
RewriteRule  ^class/([0-9]+)/([0-9]+).html$  class.php?sort=$1&page=$2
RewriteRule  ^over/([0-9]+).html$  over.php?page=$1
RewriteRule  ^top/(.*)/([0-9]+).html$  top.php?sort=$1&page=$2
RewriteRule  ^list/([0-9]+)/([0-9]+).html$  list.php?id=$1&bid=$2
RewriteRule  ^read/([0-9]+)/([0-9]+)/([0-9]+).html$  read.php?id=$1&bid=$2&cid=$3
求转换为nginx
工具转换失败了,谢谢!
作者: 小夜    时间: 2010-12-19 21:10
十分钟。
作者: cnweb    时间: 2010-12-19 21:10
你是啥工具转换的
作者: 我是小白    时间: 2010-12-19 21:11
原帖由 cnweb 于 2010-12-19 21:10 发表
你是啥工具转换的

http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
作者: 我是小白    时间: 2010-12-19 21:12
原帖由 小夜 于 2010-12-19 21:10 发表
十分钟。

谢谢小夜!
作者: 小夜    时间: 2010-12-19 21:15
手工转换的:
  1. location / {
  2. if (!-e $request_filename){
  3.             rewrite ^/index.html$ /index.php last;
  4.             rewrite ^/book/(.*).html$ /book.php?id=$1 last;
  5.             rewrite ^/class/(.*)/(.*).html$ /class.php?sort=$1&page=$2 last;
  6.             rewrite ^/over/(.*).html$ /over.php?page=$1 last;
  7.             rewrite ^/top/(.*)/(.*).html$ /top.php?sort=$1&page=$2 last;
  8.             rewrite ^/list/(.*)/(.*).html$ /list.php?id=$1&bid=$2 last;
  9.             rewrite ^/read/(.*)/(.*)/(.*).html$ /read.php?id=$1&bid=$2&cid=$3 last;
  10.         }
  11. }
复制代码

作者: 我是小白    时间: 2010-12-19 21:20
原帖由 小夜 于 2010-12-19 21:15 发表
手工转换的:location / {
if (!-e $request_filename){
            rewrite ^/index.html$ /index.php last;
            rewrite ^/book/(.*).html$ /book.php?id=$1 last;
            rewrite ^/class/(.*)/(.*).html$ /class.p ...

OK了,感谢小夜啊! v5的很啊!  不知道可以教我一下不?

[ 本帖最后由 我是小白 于 2010-12-19 21:24 编辑 ]
作者: ramonde    时间: 2010-12-19 21:30
技术贴,留名备用
作者: 小夜    时间: 2010-12-19 21:31
原帖由 我是小白 于 2010-12-19 21:20 发表
OK了,感谢小夜啊! v5的很啊!  不知道可以教我一下不?


这个很简单的,略懂一点点编程就会了。如果还看不明白,那我也很难解释清楚。




欢迎光临 全球主机交流论坛 (https://loc.010206.xyz/) Powered by Discuz! X3.4