Question

What is the difference between [L] and [end]?
last and end are the same, aren't they?

In my .htaccess I have

RewriteEngine On
RewriteBase /

# I use this only to test my $_SERVER variables
RewriteRule ^phpinfo phpinfo.php [QSA,L]

RewriteRule ^(.*)$ index.php?data=$1 [QSA,L]

and the behaviour of the both end and L is the same. I suppose that in a more complicated example it won't be, so can you give me such an example?

From the docs:

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.

and

Using the [END] flag terminates not only the current round of rewrite processing (like [L]) but also prevents any subsequent rewrite processing from occurring in per-directory (htaccess) context.

What does this mean?

Était-ce utile?

La solution

It relates to the global apache configuration. If you use [L] in httpd.conf then there still is a chance to apply some rules in .htaccess. But if you use [END] the game is over and .htaccess can not add anything

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top