I need to setup separate mod_substitute rules (Substitute directive) for different file types, and I'm not having any success.
I have tried so many different configurations, but this is the main gist of what I'm trying to do:
<VirtualHost *:80>
DocumentRoot /path/to/htdocs
ServerName websitedomain.com
<Directory "/path/to/htdocs">
AllowOverride All
</Directory>
ProxyRequests off
ProxyPass /test/ http://test.websitedomain.com/
ProxyPassReverse /test/ http://test.websitedomain.com/
<Location /test/>
ProxyPassReverse /
AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE text/html
AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE text/css
Substitute "s|([\'\"\(])/|$1/test/|iq"
AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE text/javascript
AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE application/javascript
AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE application/x-javascript
Substitute "s|([\'\"])/|$1/test/|iq"
</Location>
</VirtualHost>
The rules in place aren't exactly what I need, but it will provide me a starting point to adjust as necessary depending on the file type of the proxied file.
What ends up occurring in this case is both substitute rules are applied for all file types I have specified (html, css & javascript). I have searched alot, and haven't been able to find examples of multiple separate substitution rules in place for different files, etc. Hoping somebody here can help!