Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.htaccess RewriteRule - Difference between [L,R] and [R,L]?

Is there any difference between flag [L,R] and [R,L] e.g:

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]

?

like image 519
Mike Nowak Avatar asked Oct 21 '13 14:10

Mike Nowak


Video Answer


1 Answers

No there is no difference in 2 rules.

Order of various flags in RewriteRule doesn't matter.

Reference: httpd.apache.org/docs/current/rewrite/flags.html

like image 56
anubhava Avatar answered Sep 29 '22 10:09

anubhava