Reputation: 2184
I came across this directive in a .htaccess
file in a laravel project
RewriteRule ^ index.php [L]
but I don't understand what it does. here are the surrounding directives.
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
I understand that its the last rewrite to be made and that^
character to be the anchor for a new line, but there doesn't seem to be a pattern to match?
What does this rewrite directive do?
Does it replace the ^
(start of line) with the string index.php
, if so does the rest of the URL get retained or does the entire URL get reset to index.php
?
Upvotes: 0
Views: 35
Reputation: 29463
In the rewrite directive
RewriteRule ^ index.php [L]
^
means [START] (its counterpart is $
which means [END])
Essentially, the directive is pattern-matching any URI which begins with [START].
Obviously, that's all of them.
Upvotes: 1