Move page to follow slug name strategy

Sorry to open up an old thread, but this thread seemed the most appropriate.

Originally, I didn’t have the Name Strategy enabled, so my wiki has lots of pages with spaces in the url, such as “/xwiki/bin/view/Main/00%20Job%20Reports/all%20Matters%20in%20progress/”

Now, if I want the url to look nice (/xwiki/bin/view/Main/00-Job-Reports/all-Matters-in-progress/) with the spaces replaced with a dash and the page title otherwise unchanged I have a problem.

If I try to “move/rename” the page without changing the title with the expectation that the page url will be updated using the current naming strategy it won’t as xwiki will give me the error " Error: A page with the given name (WebHome already exists. Please provide a different name."

So what I can do is rename the page by adding an extra character to the end and saving the change. This will “fix” the url and then I can rename the page again to remove the extra character and I am left with the “perfect” page url with no spaces and no extra characters in the name.

However… If I want the page to redirect from old url to the new url, I am going to end up with 2 redirects changed together, like so:

/xwiki/bin/view/Main/0%20Introduction/

/xwiki/bin/view/Main/0-Introduction1/

/xwiki/bin/view/Main/0-Introduction/

Is there any way to update the url without doing this middle step and creating more redirects?

I think my worst (and maybe best) case solution is to rename all the pages, not create redirects and on the proxy front end, rewrite all urls with spaces to the naming strategy equivalent.

Also, I think it would get rather messy with redirects if I renamed the pages from the top down of a tree rather than from the bottom up.

Any thoughts or suggestions appreciated.

Hi @pdwalker

it sounds like a usability bug to me: if the naming strategy changed then you should be able to move the page so that it follows the new strategy. So best is probably to create a jira ticket for this.

https://jira.xwiki.org/browse/XWIKI-20478

@pdwalker I took the liberty to move all this to a new thread as I think it would bring more visibility.
Thanks for creating the jira ticket it will help for the follow up.

1 Like