VPS侦探论坛

 找回密码
 注册
查看: 8325|回复: 2

[Apache] 请教重写如何排除某个文件不进行重写?》

[复制链接]
发表于 2011-1-16 13:12:44 | 显示全部楼层 |阅读模式

请教一个问题。在nginx重写的时候,如何排除指定的xx.html文件不被重写,直接可以访问,先谢谢了。

我的重写规则是以下这样,如何在写条规则让指定的xx.html文件可以直接访问,不进行重写?

location / {
if ($args ~ "^wd=(.*)$"){
        set $rule_0 1$rule_0;
        set $bref_1 $1;
}

if ($rule_0 = "1"){
        rewrite ^/s$ /search.php?wd=$bref_1 last;
}
        rewrite ^/(.+)\.html$ /search.php?wd=$1&static=1 last;
}
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-1-16 20:33:35 | 显示全部楼层


location / {
if (!-e $request_filename) {
伪静态
}
}
试试
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-1-16 22:43:14 | 显示全部楼层

if (!-e $request_filename) {
rewrite . /qcbz3.html last;
}

是这样吗?我测试了.不行...如果是想让qcbz3.html文件不进行重写,能直接访问这个qcbz3.html该怎么写

谢谢..
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-10-18 12:31 , Processed in 0.025929 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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