Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

General redirects from old urls to new ones #1

Closed
gcharang opened this issue Apr 4, 2019 · 2 comments
Closed

General redirects from old urls to new ones #1

gcharang opened this issue Apr 4, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@gcharang
Copy link

gcharang commented Apr 4, 2019

Feature request

A way to redirect an older url to an existing url in the current site structure.
Example:
Old link: https://docs.examplesite.com/intro/basics.html to be redirected to
New Link: https://docs.examplesite.com/start-here/introduction.html

The absence of a straightforward way to do this has been discussed in Issue #160 of the Vuepress repo.

What problem does this feature solve?

When reorganizing the directory structure as well as changing the names of files and directories, this feature is useful to not break the existing bookmarks and links from other websites.

This plugin vuepress-plugin-redirect currently works for a subset of redirects where "redirecting any page to its subpages" is needed.

What does the proposed API look like?

I suggest requiring a file like https://github.com/vuejs/vue-router/blob/dev/docs/.vuepress/public/_redirects which contains the old and new links side by side or as an array of JSONs. The plugin should read the file to generate the redirects.

How should this be implemented in your opinion?

I am not sure, but the redirects in the above-linked file are working in the vue-router's website: https://router.vuejs.org/
Ex: https://router.vuejs.org/en/essentials/getting-started.html
properly gets redirected to
https://router.vuejs.org/guide/

Are you willing to work on this yourself?

I am a newbie to JS and Vue, happily using Vuepress to create documentation like: https://developers.komodoplatform.com/

But, @shigma suggested they were considering to support this feature in the plugin vuepress-plugin-redirect

@shigma
Copy link
Member

shigma commented Apr 4, 2019

Published 1.2.0-alpha.0. Can you help check whether it satisfies your needs?

docs: https://github.com/vuepress/vuepress-plugin-redirect/tree/next#alias

@shigma shigma added the enhancement New feature or request label Apr 4, 2019
@gcharang
Copy link
Author

gcharang commented Apr 4, 2019

Thank you very much! It works exactly as I needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants