[R=301,L] - What does L mean?

[R=301,L] - What does L mean? From what I found, it means " Same as ‘last’
". What exactly does this mean?

From the following two commands, which one is the better one?

RewriteRule (.*) http://somesite.tld/$1 [R=301,L]

OR

RewriteRule (.*) http://somesite.tld/$1 [R=301]

That means it is the Last rewrite rule and stops looping and/or conflicts.

Thanks!

So, it’s better to use

RewriteRule (.*) http://somesite.tld/$1 [R=301,L]

OR

RewriteRule (.*) http://somesite.tld/$1 [R=301]

?

Basically, if you have a lot of rewrite rules, it’d be better to add the L flag to save Apache from having to keep processing further rules.

Cris,

It’s my understanding that the Last flag acts as a }, i.e., it closes a BLOCK of rewrite conditions and rules so, as you would use } to close a block of PHP statements, so would you use [L] to close a “block” of mod_rewrite statements.

That said, it’s best to use [L] at the end of EACH RewriteRule unless it’s to chain to another rule - [R=301,L] is highly recommended.

Regards,

DK