rewrite part of url

Is it possible to rewrite part of url, using a script?

For example, in, there’s a resource
I’d like to script the test so I can pull this resource from

Sorry, nothing that fancy. It can do domain rewriting so you can have point to but you’d need the rest of the path to be the same.