How to redirect SharePoint Site Collection to different URL

Scenario and Requirement

Consider a scenario where you share a particular SharePoint link with your colleagues and other co-workers. Users have a tendency to bookmark frequently accessed URLs.

For some reason, this content on this page is moved and there is a new site/page which hosts the content now. If users access this page, they will get undesired results.

It will be a good idea to redirect the users to the new page (site collection, subsite, page) when the current bookmarked URL is accessed.

Simple HTML Solution

The simplest way to achieve this by using a standard HTML + JavaScript approach and adding a script for redirection.

Follow these steps -
  1. Edit the SharePoint page.
  2. Add a Content Editor web part.
  3. Add below code in the content editor web part. Optionally you can also display a message if needed.
  4. This page has shifted, you are being redirect to
  5. <script>
    window.location.href = "";
  6. Save web part changes.
  7. Save and publish the page.
  8. Test the page for redirection.

By doing so, the page will instantly navigate and redirect the user to the specified URL.

Try Out Code2care Dev Tools:


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.