2

I am quite new to Apache HTTP Server.

I am using the mod_substitute to transform urls like

http://www.example.com/appName/...

into

http://www.example.com**/root**/appName/... 

My problem is handling urls like

http://www.example.com/appName/.../appName.js

Because my rewrite rule

SetOutputFilter INFLATE;SUBSTITUTE;DEFLATE
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|/appName|/root/appName|i"

transform the above url in

http://www.example.com/root/appName/.../root/appName.js

and this will result in a 404 error.

Is there a way to substitute only the first occurrence with mod_substitute?

Any advice is appreciated.

Christine
  • 5,617
  • 4
  • 38
  • 61
Rijndaal
  • 21
  • 4
  • I'm late, but this may help: https://unix.stackexchange.com/questions/188264/want-to-substitute-only-first-occurence-with-sed – Christine Jun 16 '18 at 20:39
  • Your question helped me because I didn't have the SetOutputFilter directive. Now I have and my filter works. – Christine Jun 16 '18 at 20:39

0 Answers0