How can we redirect a SharePoint page to a different Site Collection

Wolfe, Thomas 61 Reputation points
2021-10-15T23:39:08.593+00:00

How can we redirect a SharePoint page to a different Site Collection

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,756 questions
0 comments No comments
{count} votes

Accepted answer
  1. Allen Xu_MSFT 13,776 Reputation points
    2021-10-18T03:01:44.947+00:00

    Hi @Wolfe, Thomas ,

    You can inject the following JS code to a SharePoint Online page. You can copy it from the attached RedrictPageJS.txt.
    141185-image.png

    Once you save the page and refresh it will redirect. See my demonstration.
    141089-demo1.gif

    You can use the modern script editor web part to inject the JS code: https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-script-editor. Take a reference to this article on how to deploy the web part to your SharePoint Online site: SharePoint | Online | Best Practice | install Modern Script Editor Web Part for SharePoint Online Modern Site.

    ----------

    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 additional answers

Sort by: Most helpful