摘要: Apache的rewrite规则详细介绍 发布日期:2008-09-02 16:16来源:作者:点击:7044rewrite标志R[=code](force redirect) 强制外部重定向强制在替代字符串加上http://thishost[:thisport]/前缀重定向到外部的URL.如果code不指定,将用缺省的302 HTTP状态码。F(force URL to be forbidden)禁用URL,返回403HTTP状态码。G(force URL to be gone) 强制URL为GONE,返回410HTTP状态码。P(force proxy) 强制使用代理转发。L(last r 阅读全文
posted @ 2013-09-04 14:37 hechunhua 阅读(154) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/analyzer/articles/1377684.html]本位转自:http://blog.c1gstudio.com/archives/434推荐参考地址:Mailing list ARChives 官方讨论区http://marc.info/?l=nginxNginx 常见应用技术指南[Nginx Tips]http://bbs.linuxtone.org/thread-1685-1-1.html本日志内容来自互联网和平日使用经验,整理一下方便日后参考。正则表达式匹配,其中:* ~ 为区分大小写匹配* ~* 为不区分大小写匹配* !~和!~ 阅读全文
posted @ 2013-09-04 13:57 hechunhua 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 首先Apache的Rewite规则差别不是很大,但是Nginx的Rewrite规则比Apache的简单灵活多了Nginx可以用if进行条件匹配,语法规则类似Cif ($http_user_agent ~ MSIE) {rewrite ^(.*)$ /msie/$1 break;} Rewrite的Flags last - 基本上都用这个Flag。 break - 中止Rewirte,不在继续匹配 redirect - 返回临时重定向的HTTP状态302 permanent - 返回永久重定向的HTTP状态301 Wordpress的重定向规则:if (!-e $request_fi... 阅读全文
posted @ 2013-09-04 13:42 hechunhua 阅读(470) 评论(0) 推荐(0) 编辑