How to Redirect Users from One SharePoint Site to Another Using the Content Editor Web Part

Do you want to redirect users from one site to another in SharePoint?
Maybe you’re migrating from SharePoint 2007 to SharePoint 2010 and you want users who have bookmarks to receive a notification before you completely pull the plug.

Well, this post will give you a way to use the Content Editor Web Part to prompt users with a dialog informing them the site is being moved, and then automatically redirect users from one site to another.

Step 1:
Go to the source site that you would like users to be redirected from.
On this site, click 'Site Actions' > 'Edit Page'

Step 2:
Add the 'Content Editor Web Part' to any zone on the page. Click 'Add a Web Part'

You should now see the 'Add Web Parts' Windows where you can choose the Content Editor Web Part as shown below:

Select 'Content Editor Web Part' and click 'Add'.

Step 3:
Next, we need to modify the web part by clicking 'Edit' > 'Modify Shred Web Part'.

Once we have clicked the modify button a window opens on the right hand side of the browser with various options for the web part. We want to add our code to the webpart that does the redirect when a users lands on the page.

Click the 'Source Editor' button

In the window that opens up, we need to enter the code for the redirect as follows:
*Note: Change MYSITEURL to the site you will redirect your users to. This is your destination site.
You can also customize the message text below if desired:

<script type=""text/javascript"">// <![CDATA[
alert("This site has been moved to another location, please update all existing bookmarks. If you have questions or concerns, please contact the Help Desk. You will be redirected momentarily.");
// ]]></script>
<meta http-equiv="refresh" content="5;url=http://MYSITEURL/Pages/default.aspx">



Click the 'Save' button, and publish the page, then you're done!

Users who navigate to this page will be greeted with a popup and redirected in 5 seconds (the default time). 
*Note: If you want to change the amount of time before the redirect simply change the number of seconds by editing the following number representing the time lapse:


<meta http-equiv="refresh" content="5;url=http://SITEURL/Pages/default.aspx">

No comments:

Post a Comment