When the company migrated from WSS 3.0 to MOSS 2007 and then from MOSS 2007 to SharePoint 2010, we received a lot of requests from our customers to put a script that would redirect site visitors and users to the new site, if a new one had been created. And this is what this post is about.

Note: This solutions calls for the use of  a Content Editor Web Part. As I have stated in previous posts, I am not too happy with the way SharePoint 2010 might change the code I put on Content Editor Web Parts. To prevent SharePoint from changing my code, I usually upload a TXT file to a document library on the site and I reference the file from the Content Editor Web Part.
1. Edit the page where you would like to include the redirect script

2. Add a Content Editor Web Part on the page

3. Edit the Content Editor Web Part properties, remove chrome, rename the web part to something more meaningful than 'Content Editor' (such as, Redirect), and make any other changes as applicable to your own situation

4. Select the Content Editor Web Part Click here to add new content link

5. Locate the HTML icon within the Markup section of the ribbon, select it, and then select Edit HTML Source

6. Type in (or copy and paste) the code below in the HTML Source web page dialog that displays

<script '"text/javascript"'>//<![CDATA[alert("This site has been moved to another location. Please update all existing bookmarks. You will be redirected momentarily.");//]]></script>
<meta http-equiv="refresh" content="10;url=https://www.sharepointbinder.com">

7. Select [OK] and save the page.

The script above is set up to redirect after 10 seconds. Modified this setting to your own needs.

Remember to also replace the URL above with the appropriate destination URL that applies to your particular situation.

Your comment will be posted after it is approved.

Leave a Reply.