8
I don’t quite understand the way the flag works L
.
The doubt arose when I was trying to use the following script:
#quando vier o "public" na url, reescreve para folder/public
RewriteRule ^public/(.*)$ folder/public/$1 [NC]
Rewrite ^(.*)$ folder/public/$1 [NC]
The objectives were:
The first:
mysite.com
rewrite to mysite.com/folder/public
.
The second (due to poor structure of the developed system):
mysite.com/public/img.jpg
rewrite to mysite.com/folder/public/img.jpg
The second was not working. However, when adding [NC,L]
, everything worked as expected.
Thus:
RewriteRule ^public/(.*)$ folder/public/$1 [NC]
Rewrite ^(.*)$ folder/public/$1 [NC]
What the L
did in my rewrite rule?
Which means the other flags, like R
and NC
?