Yes, you could create a document at location /r and add Javascript to this document, which simply does:
document.location.href = "/x/y/z/a";
But for many reasons you should not.
- This is not a redirect (you can return to your browser, so you basically break your story).
- You rely on javascript
- This will have a negative impact on SEO.
- He is slower
- ...
You really should try to handle this on the server side of your application.
source share