I'm attempting to rewrite Web addresses baked into various file types via Apache mod_substitute. It is really an effort to "repoint" individuals Web addresses to some CDN provider. This is actually the relevant httpd.conf snippet to supply some context.

SetEnv CDN_STATIC_PATH cdn.mycompany.com/static/

AddOutputFilterByType SUBSTITUTE text/html
AddOutputFilterByType SUBSTITUTE text/javascript
AddOutputFilterByType SUBSTITUTE application/xml
AddOutputFilterByType SUBSTITUTE text/css

Substitute s@(src|href)=('|")/static/@$1=$2https://cdn.mycompany.com/static/@i

I'm trying to puzzle out ways to use the atmosphere variable within the replace clause from the Substitute line to ensure that it appears something similar to this (pseudo code):

Substitute s@(src|href)=('|")/static/@$1=$2https://%CDN_STATIC_PATH%@i

note, the @ may be the delimiter towards the Substitute call.

Any ideas?