It is possible to have native HTTP redirects for pages moved or renames in Confluence?
Asked by Sorin Sbarnea (Citrix):

It is possible to have native HTTP redirects for pages moved or renames in Confluence?

How?

One condition: this has to work by default, without having to ask the user to do somethign else after he moves or renames the page.

I was amazes to discored that this basic functionality was not a core feature by design.  
[](https://community.atlassian.com/t5/Confluence-questions/It-is-possible-to-have-native-HTTP-redirects-for-pages-moved-or/qaq-p/326031?attachment-id=5448){#link_118b49ee51a6cf}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/54960/1/moving_a_page.PNG){#display_118b49ee51a6cf_0}


Answers:
author: David Yu
body: According to the docs, all links should update automatically when you move or rename a page. You just have to make sure your links are not web-links that start with http...use Confluence page links instead.

<https://confluence.atlassian.com/display/DOC/Moving+a+Page>

<https://confluence.atlassian.com/display/DOC/Renaming+a+Page>

comments: author: Sorin Sbarnea (Citrix)
body: I will test this myself. Still I do think that confluence should be smart enough to fix even web-links. We cannot assume that everyone will insert only internal links when writing wiki pages. I would not even consider this as an enhancement, just a bug.


author: Matthew J. Horn
body: Sorin, I disagree with you... There should be no expectation that Confluence will keep external links updated.


author: Sorin Sbarnea (Citrix)
body: I would be interested to find out why you disagree.


author: Matthew J. Horn
body: Maybe we're not thinking of the same thing.

I'm thinking if you have, say, a link on a Confluence page to, say, a page on [stackoverflow.com](http://stackoverflow.com) (let's use <http://stackoverflow.com/questions/17227155/no-matter-what-i-do-i-cant-get-my-javascript-files-to-run-on-phonegap>)... if that Stackoverflow page's link changes, then Confluence would have no way of knowing where the new URL is, unless the owners of Stackoverflow provided a redirect URL or some other info in the response to indicate the new location.


author: Sorin Sbarnea (Citrix)
body: Shortly, Confluence should be able to detect 301 and 308 HTTP responses and correct the links inside the pages. Also, Confluence shold return 301 HTTP responses for pages that were moved or renamed. These are two different features but that by combining do solve the missing page problem in the correct way (the web way). The current behavioud of responding with 200 response and a page that is telling you that the content was moved is silly and denotes a clear lack of knowledge on how an web application is supposed to be implemented.


author: Sam Calder
body: Ironically, clicking that very link posted earlier (<https://confluence.atlassian.com/display/DOC/Moving+a+Page>) now renders as a 404 because ***someone moved the page***:

moving_a_page.PNG

* Expecting Confluence to keep external/outbound links up-to date (via polling, prefetching, whatever) is achieveable. HTTP 301 requires the new URI for the resource in the response, so if the external resource is well-behaved then Confluence should be able to work with it. Personally I agree with Sorin, but I can also understand why some folks would make the argument that external URIs are out of scope.
* Expecting Confluence to keep internal/inbound links up-to-date should be a given, and IMHO it is embarrassing that this is not the case. Even MediaWiki managed to make this work years ago. It shouldn't matter whether the link was created from raw html, or Confluence markup, or whatever. If it is rendered to the end-user as a link, it is a link. Confluence should be able to detect and maintain incoming links regardless of whatever format was used to input them. If it is a link within the same Confluence instance, there is no excuse for not redirecting properly.

Documentation in most organisations will exist in a continuous state of flux, and probably as a heterogeneous combination of emails / multiple wikis / documents on fileshares / links embedded in source code/comments / etc. etc... most of which will likely have static links, and these will grow increasingly stale as time passes. Having them return 404 for a moved Confluence resource harms the user-experience, and therefore (likely) also the adoption of Confluence. It's also contrary to RFC7231:

<https://tools.ietf.org/html/rfc7231#section-6.4.2>


author: Ariel Lieberman
body: I've added html macro to the page an put the below in

```
<!DOCTYPE html><html><body><h2>Redirect to a Webpage</h2><script>  location.replace("link to the new location")</script></body></html>
```

comments: author: Long
body: Unfortunately this is not native HTTP 301 redirect.