建站之星产品帮助

标题: 在nginx下 伪静态失败 [打印本页]

作者: coo    时间: 2010-9-24 19:36
标题: 在nginx下 伪静态失败
  1. rewrite /([a-zA-Z_]{1,})-([a-zA-Z_]{1,}).html$ /index.php?_m=$1&_a=$2;
  2. rewrite /([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,}).html$ /index.php?_m=$1&_a=$2&$3=$4;
  3. rewrite /([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,})-([a-zA-Z_]{1,})-([0-9]{1,}).html$ /index.php?_m=$1&_a=$2&$3=$4&$5=$6;
复制代码


转换成这样的 结果NGINX直接无法启动
有人看看是那里错了吗
作者: 85chance    时间: 2010-10-11 17:11
是啊,提示如下错误,有办法解决吗?我的服务是nginx的啊

directive "rewrite" is not terminated by ";" in
作者: 85chance    时间: 2010-10-11 19:03
本帖最后由 85chance 于 2010-10-11 19:26 编辑

  1. l
  2. location / {
  3. rewrite "/([a-zA-Z_]{1,})-([a-zA-Z_]{1,}).html$" /index.php?_m=$1&_a=$2;rewrite "/([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,}).html$" /index.php?_m=$1&_a=$2&$3=$4;rewrite "/([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,})-([a-zA-Z_]{1,})-([0-9]{1,}).html$" /index.php?_m=$1&_a=$2&$3=$4&$5=$6;
  4.   }
复制代码



楼主,我已经测试成功了,可以正常使用了,规则如上(即前部分需要加上引号),该规则是网站安装在根目录的
作者: 85chance    时间: 2010-10-11 19:06
回复 4# hong


   谢谢管理员的回复,我的已经可以使用,感谢建站之星!
作者: mczb    时间: 2010-10-11 19:21
也感谢您的反馈,您的反馈我们这边也将进行测试并改进。
作者: 85chance    时间: 2010-10-11 19:44
不好意思,之前的规则代码会导致进不了后台,现在修改为以下,可以顺利进入后台,欢迎各位测试!

location / {

rewrite "^([^\.]*)/([a-zA-Z_]{1,})-([a-zA-Z_]{1,}).html$" $1/index.php?_m=$2&_a=$3;
rewrite "^([^\.]*)/([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,}).html$" $1/index.php?_m=$2&_a=$3&$4=$5;
rewrite "^([^\.]*)/([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,})-([a-zA-Z_]{1,})-([0-9]{1,}).html$" $1/index.php?_m=$2&_a=$3&$4=$5&$6=$7;
rewrite "^([^\.]*)/admin/([a-zA-Z_]{1,})-([a-zA-Z_]{1,})\.html$" $1/admin/index\.php\?_m=$2&_a=$3;
rewrite "^([^\.]*)/admin/([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,})\.html$" $1/admin/index\.php\?_m=$2&_a=$3&$4=$5;

        }
作者: coo    时间: 2011-1-5 12:20
不错哦 支持下哈!~
作者: xx2017    时间: 2011-1-5 12:27
支持下哈!~
作者: 九天    时间: 2011-3-14 17:18
谢谢 成功了。。
作者: 2310692    时间: 2011-3-23 12:57
非常感谢8楼的童鞋,成功了!!!
作者: Ghost    时间: 2011-3-23 18:33
感谢您对建站之星的支持与关注,祝您建站愉快!




欢迎光临 建站之星产品帮助 (http://bbs.sitestar.cn/) Powered by Discuz! X3.3