Implement rewrite functionality for rel_url() and abs_url() and underlaying functions. Better internal redirects expected — rewritten URLs could end in non rewritten.