Use basename and dirname to attach purge link filter