apache中301和403优先级
2016-01-11 03:20
696 查看
配置如下
<Directory /data/www/>
Order allow,deny
Allow from all
Deny from 172.168.1.160
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.456.com$
RewriteRule ^/(.*)$ http://www.123.com/$1 [R=301,L]
</IfModule>
当禁止本地访问/data/www时,
#curl -x127.0.0.1:80 'http://www.456.com/1.txt'
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.123.com/1.txt">here</a>.</p>
</body></html>
#
因此,301跳转的优先级较高于403禁止
<Directory /data/www/>
Order allow,deny
Allow from all
Deny from 172.168.1.160
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.456.com$
RewriteRule ^/(.*)$ http://www.123.com/$1 [R=301,L]
</IfModule>
当禁止本地访问/data/www时,
#curl -x127.0.0.1:80 'http://www.456.com/1.txt'
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.123.com/1.txt">here</a>.</p>
</body></html>
#
因此,301跳转的优先级较高于403禁止
相关文章推荐
- Apache Isis 1.4.0 发布,领域驱动开发框架
- Linux快速构建apache web服务器
- Awstats处理多apache日志
- 安装perl模块小窍门
- PHP+Apache在Windows 9x下的安装和配置
- Apache服务器配置全攻略
- Apache Web让JSP“动”起来
- Linux Apache+MySQL+PHP
- 建立Apache+PHP+MySQL数据库驱动的动态网站
- apache 环境下 php 的配置注意事项
- C#中38个常用运算符的优先级的划分和理解
- 在RedHat下安装apache jserv 1.1.2方法
- Ruby的运算符和语句优先级介绍
- windows8.1下Apache+Php+MySQL配置步骤
- windows中PHP5.2.14以及apache2.2.16安装配置方法第1/2页
- 在Windows XP下安装Apache+MySQL+PHP环境
- 解析阿里云ubuntu12.04环境下配置Apache+PHP+PHPmyadmin+MYsql
- apache rewrite防盗链三例
- Apache 配置详解(最好的APACHE配置教程)
- jquery 中ajax执行的优先级