I've recently had to change a path in my app, but I would like to preserve the validity of old deep links by redirecting them. Here's an example of a changed path:
Original: /foo/users/12345
Updated: /bar/users/12345
I tried to implement this using a redirect:
<Route path='/bar' component={MyComponent} />
<Route path='/foo'>
<Redirect to='/bar' />
</Route>
However, the latter part of the request is lost in a redirect. So a request to /foo/users/12345
redirects to /bar
.
Is there a declarative way to pass the /users/12345
portion of my path along in the redirect?