6

On GitHub I created a wiki page, "Page1", but now I realize it was a bad name and I want to rename it to "Page2" instead.

There are many external third-party HTTP links to Page1, so deleting it would be bad for the users and for SEO.

Is there a way to redirect Page1 to Page2 like in Wikipedia?

(GitHub uses the Gollum wiki engine)

2

I have not found any better solution than this so far:

  1. Create Page2,
  2. Copy-paste content of Page1 to Page2,
  3. Replace content of Page1 with a link to Page2 like this: Moved, please see [[Page 2]].
1

Solution with keeping the original page

It is not possible to create a "moved permanently" response. Besides the manual way, you can do following locally:

  1. Clone the wiki repository (see URL at "Clone this wiki locally")
  2. Copy x.md to Y.md (where X is the old page, Y the new page)
  3. Replace the contents of X.md by a text and a link to Y.md (e.g. Moved, please see [[Y]]).
  4. git add -A
  5. git commit -m "Rename X to Y and add a link from X to Y"
  6. git push

Solution without keeping the original page

This is not good for SEO, but might be useful at the beginning of creation of a wiki.

You can clone the wiki repository (see URL at "Clone this wiki locally"), rename the file locally, do a git add -A, git commit -m "Rename file" and a git push.  

  • You need to stage the new file. – SOFe Jul 31 '16 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.