I keep seeing the ^
character in RewriteRule
statements in a context that doesn't fit with the usage specified in this document about regular expressions.
For example: RewriteRule ^(.*)$ $1.php [L,QSA]
What does it signify?
Webmasters Stack Exchange is a question and answer site for webmasters. It only takes a minute to sign up.
Sign up to join this communityI keep seeing the ^
character in RewriteRule
statements in a context that doesn't fit with the usage specified in this document about regular expressions.
For example: RewriteRule ^(.*)$ $1.php [L,QSA]
What does it signify?
It means "this matches the start of the string". So in your example the rule does the rewrite if there's
^
).
)*
)$
)In other words, this whole expression matches any string.
RewriteRule
pattern). However, regex in Apache config files don't use delimiters.