.htaccess RewriteRule - [L,R]和[R,L]之间的差异?

时间:2013-10-21 14:18:08

标签: apache .htaccess mod-rewrite

标志[L,R]和[R,L]之间是否存在差异,例如:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]

VS

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]

1 个答案:

答案 0 :(得分:5)

2条规则没有区别。

RewriteRule中各种标记的顺序无关紧要。

参考: httpd.apache.org/docs/current/rewrite/flags.html