宇宙主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

欧基零壹微头条IP归属甄别会员请立即修改密码
12
返回列表 发新帖
楼主: kzhangtao

求转Nginx伪静态规则

[复制链接]
发表于 2013-1-16 13:04:41 | 显示全部楼层
个人认为Nginx始终还不够成熟,伪静也不太好操作!
 楼主| 发表于 2013-1-16 13:05:16 | 显示全部楼层
ihosting 发表于 2013-1-16 13:02
试试这个:
  1. Restarting nginx daemon: nginxnginx: [emerg] unknown directive "range=$2&amp" in /usr/local/nginx/conf/demo.conf:5
复制代码
发表于 2013-1-16 13:16:41 | 显示全部楼层
  1.         rewrite ^/gallery\\/?$ /gallery.php last;
  2.         rewrite ^/gallery\\/(new|popular)\\/(today|week|month|all)\\/([0-9]+)\\/?$ /gallery.php?order=$1&range=$2&page=$3 last;
  3.         rewrite ^/([a-zA-Z]+)\\/?$ /index.php?i=$1 last;
  4.         rewrite ^/a\\/([a-zA-Z]+)\\/?$ /index.php?a=$1 last;
  5.         rewrite ^/(small|medium|square)\\/([a-zA-Z]+)\\.([a-z]{3,4})$ /php/resize.php?m=$1&a=$2&e=$3 last;
  6. if (!-f $request_filename){
  7.         set $rule_5 1$rule_5;
  8. }
  9. if ($rule_5 = "1"){
  10.         rewrite ^/([a-zA-Z]+)\\.([a-z]{3,4})$ /php/resize.php?m=original&a=$1&e=$2 last;
  11. }
复制代码
 楼主| 发表于 2013-1-16 13:19:54 | 显示全部楼层
lonefly 发表于 2013-1-16 13:16
  1. nginx not runningnginx: [emerg] directive "rewrite" is not terminated by ";" in /usr/local/nginx/conf/demo.conf:5
复制代码
 楼主| 发表于 2013-1-16 14:41:31 | 显示全部楼层
 楼主| 发表于 2013-1-16 15:28:07 | 显示全部楼层
求帮助
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|宇宙主机交流论坛

GMT+8, 2024-11-1 12:28 , Processed in 0.058603 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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