Rewrite href to redirect URL on click for external links.

This redirect requires the CSRF token so you can't build arbitrary URLs.