docs(versions): preserve URL path. Fixes #4661

Preserve URL path when switching between doc versions. Fixes #4661