您的位置:首页 > 运维架构 > Apache

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禁止
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  apache 优先级 403