How to have .htaccess inherit defines from httpd.conf

2

1

I defined a path variable in my httpd.conf:

Define OOSPATH D:/oos

This define can be used anywhere in the httpd.conf or files which are included from there. The same path needs to be used in a Rewrite rule, but unfortunately I can not use the variable, regardless of how I specify it. Both these variants fail:

RewriteEngine On
RewriteCond "${OOSPATH}/outofservice" -f
RewriteRule (.*) /strike.html [R=503,L]

RewriteEngine On
RewriteCond ${OOSPATH}/outofservice -f
RewriteRule (.*) /strike.html [R=503,L]

Apache complains about a missing variable:

[core:warn] [pid 5032:tid 1320] AH00111: Config variable ${OOSPATH} is not defined

However if I hardcode the path, this works fine:

RewriteEngine On
RewriteCond "D:/oos/outofservice" -f
RewriteRule (.*) /strike.html [R=503,L]

How can I have .htaccess inherit the define ?

Marged

Posted 2015-09-23T12:16:23.963

Reputation: 255

No answers