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禁止

你可能感兴趣的:(apache,优先级,403)