码迷,mamicode.com
首页 > Web开发 > 详细

apache中301和403优先级

时间:2016-01-11 12:21:33      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:apache 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禁止

本文出自 “linux基础” 博客,请务必保留此出处http://chaoyuezhangsan.blog.51cto.com/7176886/1733604

apache中301和403优先级

标签:apache 301 403 优先级

原文地址:http://chaoyuezhangsan.blog.51cto.com/7176886/1733604

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!