Forget the whole function thing

Just rewrite the URL.