Hello,
I need to set the Header depending on whether the file exists or not, I don't want to use php to set the Header when the file exists.
The example below should work but for some reason it doesn't work in openlitespeed, please help.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L,E=TESTenv:1]
Header set TEST_name TEST_VALUE env=!TESTenv
Unfortunately in openlitespeed the Header TEST_name is always set regardless of whether TESTenv exists or not, so it doesn't work properly becaouse it should be set only if TESTenv doesn't exist.
Of course I do it in Context. TESTenv is set correctly, i'm checking TESTenv in this way:
Header set TESTenv %{TESTenv}e
gives in Headers:
if file doesn'n exists (RewriteRule . index.php [L,E=TESTenv:1] works)
TESTenv: 1
if file exists:
TESTenv:
Header help in openlitespeed shows:
Syntax: [Header]|RequestHeader [condition] set|append|merge|add|unset header [value] [early|env=[!]variable]
So env should be supported, it looks like a bug.
I need to set the Header depending on whether the file exists or not, I don't want to use php to set the Header when the file exists.
The example below should work but for some reason it doesn't work in openlitespeed, please help.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L,E=TESTenv:1]
Header set TEST_name TEST_VALUE env=!TESTenv
Unfortunately in openlitespeed the Header TEST_name is always set regardless of whether TESTenv exists or not, so it doesn't work properly becaouse it should be set only if TESTenv doesn't exist.
Of course I do it in Context. TESTenv is set correctly, i'm checking TESTenv in this way:
Header set TESTenv %{TESTenv}e
gives in Headers:
if file doesn'n exists (RewriteRule . index.php [L,E=TESTenv:1] works)
TESTenv: 1
if file exists:
TESTenv:
Header help in openlitespeed shows:
Syntax: [Header]|RequestHeader [condition] set|append|merge|add|unset header [value] [early|env=[!]variable]
So env should be supported, it looks like a bug.
Last edited: