[Deprecated] Manually create automatic redirect to new document
Last modified by Irina Hrehorciuc on 2022/05/03 09:30
Steps to reproduce
- Create a document http://127.0.0.1:8080/xwiki/bin/view/1/
- Bookmark this document in your browser
- Create a second document http://127.0.0.1:8080/xwiki/bin/view/A/
- Create a separate page to run the following velocity script. The script will allow you to move document 1 to be a child document of A
{{velocity}}
#set ($source = $services.model.resolveSpace('1'))
#set ($destination = $services.model.resolveSpace('A'))
$services.refactoring.move($source, $destination).join()
{{/velocity}} - Go back to http://127.0.0.1:8080/xwiki/bin/view/1/ and recreate this page. In edit mode add the following redirect snippet and then save the page.
{{velocity}}
$response.sendRedirect($xwiki.getURL('A.1'))
{{/velocity}} - Click on the bookmark you made earlier.
Expected results
You have just manually created an automatic redirect link from http://127.0.0.1:8080/xwiki/bin/view/1/ to http://127.0.0.1:8080/xwiki/bin/view/A/1/ . The existing bookmark to the original document path continues to work, after manually creating a document with the old name and inserting the code snippet to perform the redirect. (MO5)
Results
per page of Previous Page Next Page Page | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Previous Page Next Page Page |