Many posters have problems debugging their RewriteRule and RewriteCond statements within their .htaccess
files. Most of these are using a shar
You can create new environment variables with RewriteRule lines, as mentioned by OP:
RewriteRule ^(.*) - [E=TEST0:%{DOCUMENT_ROOT}/blog/html_cache/$1.html]
But if you can't get a server-side script to work, how can you then read this environment variable? One solution is to set a header:
Header set TEST_FOOBAR "%{REDIRECT_TEST0}e"
The value accepts format specifiers, including the %{NAME}e
specifier for environment variables (don't forget the lowercase e). Sometimes, you'll need to add the REDIRECT_
prefix, but I haven't worked out when the prefix gets added and when it doesn't.