views:

265

answers:

5

Like here:

RewriteEngine on 
RewriteRule ^(.*)\.[\d]+\.(css|js)$ $1.$2 [L]
+1  A: 

If the rule matches, no more will be processed.

Check out the full list of flags: http://httpd.apache.org/docs/2.2/rewrite/rewrite%5Fflags.html

Matt
A: 

it means last, the rewrite engine will stop searching for matching rules. You can consult the documentation.

Usually it's use to avoid to match other rule, you can use it when you are sure you don't need to do any other rewriting.

RageZ
+1  A: 

It means that if this rule matches, no more rule matching should be done. L = Last.

Documentation for l/last.

lemonad
+1  A: 

The [L] flag causes mod_rewrite to stop processing the rule set. In most contexts, this means that if the rule matches, no further rules will be processed.

From the Apache mod_rewrite Flags documentation.

Rudd Zwolinski
+3  A: 

[L] is a flag that means that if this rule matches, then no other rule matching will be performed for this page.

The mod_rewrite documentation says:

The [L] flag causes mod_rewrite to stop processing the rule set. In most contexts, this means that if the rule matches, no further rules will be processed.

However, the documentation goes on to note that [L] should not be relied on on its own to stop mod_rewrite processing as if, for example, your rule causes an HTTP redirect then it's possible to re-encounter the ruleset again, which can result in infinte loops.

It is therefore important, if you are using RewriteRule directives in one of these context that you take explicit steps to avoid rules looping, and not count solely on the [L] flag to terminate execution of a series of rules

NeilCrosby