Forum Discussion
Alex-S-NZ
Sep 19, 2022Copper Contributor
Can you create a SharePoint redirect site using the REDIRECTSITE#0 template?
If you accidentally deleted a redirect site that led from sharepoint.com/sites/old-url to sharepoint.com/site/new-url (that had the REDIRECT#0 template), is there any way to recreate the redirect sit...
Sep 20, 2022
Alex-S-NZ would this work for you?
No-code modern SharePoint site redirect - M365 Dev Blog (m365-dev.com)
- Alex-S-NZSep 20, 2022Copper Contributor
This could be a solution - thanks for posting it! I'll let you know how I get on. Just out of curiosity will it redirect everything - or just links to the main page?
For example - if a webpage was linking to sharepoint.com/site/oldsite/files/file1.jpg would this method forward the request to sharepoint.com/site/newsite/files/file1.jpg ? I guess I'm looking for the equivalent of a .htaccess rewrite rule or something which has the same features as the REDIRECT#0 template implementation.
- NanddeepNachanSep 20, 2022Learn Expert
Did you try swapping the site one more time?
- Alex-S-NZSep 24, 2022Copper ContributorNo, because there are a large number of site redirects that were deleted. And it would also involve swapping the sites twice for each one and disabling the site deletion policy to ensure all links in the organisation continue to work - this would mean:
- Renaming the new site URL to the old site URL (that is, to the URL of the redirect site that was deleted)
- Disabling the site deletion policy
- Deleting the new site URL after disabling the site deletion policy
- Rename the old site URL back to the new site URL in order to re-establish the redirect site.
Although it is an interesting solution I wouldn't try it unless there was no other option.
In the meantime I have engaged Microsoft to recover the redirect sites.
It seems very odd to me that Microsoft documentation doesn't warn people when running Power Shell Commands that some of the sites are redirect sites that are created and managed by Microsoft - but still allow them to be deleted without identifying them as redirect sites. And then unlike regular sites which are deleted the redirect sites don't go into the recycle bin in case you need to recover them.
As far as I'm concerned it is completely normal in large organisations to have business units change their name on numerous occasions over the time. This often necessitates the changing of the site URL - which is why these redirect sites exist to begin with. So old links continue to work.
The fact that Microsoft makes no mention of the importance of not deleting these links (unless they are orphaned redirect sites - that is, the site they link is also not required) is a pretty big oversight as far as I'm concerned.