Does anyone knows when IS_SUBREQ variable is "true"? Everything, that i've tried, gave me only "false".
Info from apache docs
IS_SUBREQ Will contain the text "true" if the request currently being processed is a sub-request, "false" otherwise. Sub-requests may be generated by modules that need to resolve additional files or URIs in order to complete their tasks.
Could anyone show me some example when IS_SUBREQ is "true"?
Some of what i tried: subreq.php - page with only
Testing browser's subrequest for image (I know that server doesn't care about it, but tried)
RewriteCond %{IS_SUBREQ} true
RewriteRule (.*)\.png$ null
Testing internal redirects
RewriteRule subreq\.php$ \tmp
RewriteCond %{IS_SUBREQ} true
RewriteRule tmp$ /index.html
No effect.
As per Apache Manual subrequest is:
a page which is included using an SSI (Server Side Include) is a subrequest, and you may want to avoid rewrites happening on those subrequests. Also, when mod_dir tries to find out information about possible directory default files (such as index.html files), this is an internal subrequest, and you often want to avoid rewrites on such subrequests
So to get value of %{IS_SUBREQ}=true have a RewriteRule like this:
DirectoryIndex index.php
RewriteEngine On
RewriteCond %{IS_SUBREQ} true
RewriteRule ^index\.php$ $0?s=%{IS_SUBREQ} [L]
http://site.com//index.php if you dump $_GET['s'] you will see value true.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With