I did not understand the operation of the L
flag very well.
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 goals were:
The first one:
mysite.com
rewrite to mysite.com/folder/public
.
The second (due to poor system structure developed):
mysite.com/public/img.jpg
rewrite to mysite.com/folder/public/img.jpg
The second was not working. However, by adding O% with%, everything worked as expected.
So:
RewriteRule ^public/(.*)$ folder/public/$1 [NC]
Rewrite ^(.*)$ folder/public/$1 [NC]
What did [NC,L]
do in my rewrite rule?
What does the other flags, such as L
and R
?