I would like to do URL rewrite which looks like not so easy deal here.
Say I want to replace url’s with
Let’s have following config
acl OLD_PATH path_reg -i /boom/\d+/bam reqrep ^([^\ :]*) /boom/(\d+)/bam \1 /bam/\2\boom redirect code 301 prefix / drop-query if OLD_PATH
It looks fine, but the redirect won’t happen because the path has been already replaced, so I can’t use OLD_PATH acl anymore.
Yet, if I create new ACL with the new path (/bam/_/boom) then I’ll be throwing 301 at all requests, not just the ones that required replacing.
How can I have ACL run against the old request line?