How to redirect SharePoint Site Collection to different URL


Posted on : Mon, 19th Oct 15 06:17 pm UTC
2314 votes

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 URL's.
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, sub site, page) when the current bookmarked URL is accessed.

Simple HTML Solution

Simplest way to achieve this by using 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 content editor web part. Optionally you can also display a message if needed.
  4. This page has shifted, you are being redirect to http://code2care.org
    <script>
    window.location.href = "http://code2care.org";
    </script>
    
  5. Save web part changes.
  6. Save and publish page.
  7. Test the page for redirection.

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

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +