After renaming a SharePoint Online document library folder, from /OldName to /NewName, how to redirect URLs for everything inside the folder, so older URLs forward to new URLs?

frob 4,221 Reputation points
2022-08-29T18:45:50.967+00:00

Hi there
After renaming a SharePoint Online document library folder, from /OldName to /NewName, how to redirect URLs for everything inside the folder, so older URLs forward to new URLs?

Happy to use PowerShell or any other way.

E.g.

  • /documents/OldFolder/abc/abc.dox is forwarded to /documents/NewFolder/abc/abc.dox
  • /documents/OldFolder/abc/bbc/cbc/ is forwarded to /documents/NewFolder/abc/bbc/cbc/

And, so on.

Thanks.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,674 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,520 questions
0 comments No comments
{count} votes

Accepted answer
  1. Callum Crowley 171 Reputation points
    2022-08-29T19:44:55.793+00:00

    This isn't possible in SharePoint Online but I would consider utilising the document ID feature, so that documents can be tracked regardless of their location in the library.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Yi Lu_MSFT 17,481 Reputation points
    2022-08-30T08:12:03.08+00:00

    Hi @frob
    The folder defines the path. There's no way of getting around this. It's just like renaming a folder on your hard drive. If you have a link to a file on your hard drive, then change the folder name, any links to the previous folder will break since that folder no longer exists.

    However, we could use the old library url after we rename the library by library settings >list name, description and navigation.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.