Mobile app version of vmapp.org
Login or Join
Hamaas447

: What's the "^" in RewriteRule Statements? 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.

@Hamaas447

Posted in: #Htaccess #ModRewrite

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 ^(.*)$ .php [L,QSA]

What does it signify?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Hamaas447

1 Comments

Sorted by latest first Latest Oldest Best

 

@Candy875

It means "this matches the start of the string". So in your example the rule does the rewrite if there's


the start of the string (^)
any character (.)
any number of the previous character (*)
the end of the string ($)


In other words, this whole expression matches any string.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme