I’m wondering if there is a method in PHP for getting the values of specific rules set out in a .htaccess file? In basic terms: if there is a (for example) RewiteBase rule, what is it’s value?
There does not seem to be anything to serve this in the Manual for $_SERVER, perhaps fread()?
Nope there is no way to retrieve it.
RewriteBaseitself is not a rule, it is just a string that will be cut off the url before rewriting process.So php just doesn’t have any chances to retrieve it
PS: personally I cannot think of any reason to rely on its value. Probably you’re trying to solve some issue in a wrong way.
PPS: I put answer to the @Adi’s question from the comments here:
It is not possible to just read the
.htaccessbecause of:.htaccessfiles in different directories and you cannot be sure which one has been usedRewriteCondcan be specified inhttpd.conf