Text in Expression Editor:
Text after Path > Rewrite to... > Dynamic:
Create a rewrite URL rule (part of Transform Rules) to rewrite any requests for /images/<FOLDER1>/<FOLDER2>/<FILENAME>
to /img/<FILENAME>
.
To rewrite paths like /images/<FOLDER1>/<FOLDER2>/<FILENAME>
— where <FOLDER1>
, <FOLDER2>
, and <FILENAME>
can vary — to /img/<FILENAME>
, create a rewrite URL rule with a dynamic rewrite of the path component:
Text in Expression Editor:
Text after Path > Rewrite to... > Dynamic:
For example, this rule would rewrite the /images/nature/animals/tiger.png
path to /img/tiger.png
.