How do I remove a redirect?
Introduction
A page representing (or containing) a "redirect" will automatically forward you to a different URL if you try to open it.
As you're immediately redirected from such a page, removing or editing the redirect requires specific procedures.
Modifying or deleting the different types of automatic redirects XWiki supports require different approaches.
Removing XObject Redirects
These are redirects implemented by adding an XObject of class XWiki.RedirectClass.
When moving/renaming pages, you have the option to create redirects for the old location so that users hitting the old page would be redirected to the new location. When doing so, XWiki adds an XObject of class XWiki.RedirectClass to the page.
We're currently missing a Redirect Management UI to be able to see all redirects and perform actions on them, such as removing some redirects. While waiting for a proper Redirect Management UI, here's a workaround:
- Turn on "hidden" documents in your profile preferences
- Navigate to the XWiki.RedirectClass page in your wiki. For example: http://localhost:8080/xwiki/bin/view/XWiki/RedirectClass##
- This will list all redirects found on your wiki, with the ability to delete each page (you'll need to have the proper right to see the "delete" action of course).
Here's an example from xwiki.org:
Another option to delete a redirect page is to hand-craft the delete URL manually (find the view URL and replace view by delete) but this is more complex and you'd need to understand the Standard URL Format.
Removing Scripting Redirects
Removing scripting redirects again, once added, can prove to be difficult. Indeed when navigating to the page, you're redirected without the possibility to edit the original page containing the redirect.
The solution is to handcraft the URL and replace view by edit. However, if your user is using the WYSIWYG editor by default, the redirect script will be executed in edit mode, redirecting you to the target page before you have a chance to remove or alter the redirect...
In this case the solutions is to append ?editor=wiki to the URL. For example if the page is:
Then you manually have to change the URL as follows:
This will cause the wiki text editor to open with the page's source code and the redirect can be edited or removed without any problems.