Alexander's Blog

Sharing knowledge with the global IT community since November 1, 2004

How to Redirect SharePoint 2010 Page Using Content Editor Web Part

/
/
ad-mania

I was running my Seattle Windows Networking User Group Web site on MOSS 2007. I was using a User Group template that was specifically designed for MOSS 2007. Recently I moved my site from MOSS 2007 to SharePoint Server 2010. I decided to use the Team Site template in SharePoint Server 2010. I had to do a bunch of tweaks to my Web site because I wasn’t able to port a lot of my customizations. My homepage used to be http://www.winnetusergroup.com/default.aspx. However, for the new site I used a publishing page as my homepage so the URL is http://www.winnetusergroup.com/Pages/default.aspx.

I wanted to redirect the User Group members that have bookmarked the old URL to the new homepage. I opted to use the Content Editor Web Part. Why? Because it’s one of my favorite Web parts and it is very simple to add a meta tag to redirect people to a different page. You can use this technique to redirect your SharePoint site, or just a page, to another location. Here’s what I did.

  1. I edited the default.aspx page that was loading my old homepage (http://www.winnetusergroup.com/default.aspx).
  2. Then I added the Content Editor Web Part.
  3. I edited the Web part and added the following text at the beginning of the page:
    Our homepage has moved to http://www.winnetusergroup.com/Pages/default.aspx. Please update all your existing Favorites/Bookmarks. You will be automatically redirected to the new homepage in 10 seconds.
  4. I added the following meta tag.
    <meta http-equiv=”refresh” content=”10;url=http://www.winnetusergroup.com/Pages/default.aspx”>
  5. The entire code on the old homepage looks like this.

Our homepage has moved to http://www.winnetusergroup.com/Pages/default.aspx. Please update all your existing Favorites/Bookmarks. You will be automatically redirected to the new homepage in 10 seconds.

<meta http-equiv=”refresh” content=”10;url=http://www.winnetusergroup.com/Pages/default.aspx”>

I experimented with the number of seconds after which the page is redirected (“content=” value). I settled with ten seconds because that gives my members enough time to read the text and gives me enough time to edit the page in Internet Explorer. One thing that I would suggest is to configure the page exactly as you want but while you are experimenting make sure that the redirection time is set to a longer period so you can easily go back and edit the page.

NOTE: There are lots of ways to redirect a site or a Web page, JavaScript, IIS redirection, meta tags, etc. This is one of the many methods that you can use. Each method has some pros and cons associated with it. For example, with this method users are not able to easily use the back button.

This is not the most ideal way to redirect page. I am not a developer and if you ask a developer she might tell you that there are better ways to redirect a page. This is the method that I use because I find it very simple. I can also export the Web part and import it to any Web part page on my site. If you don’t want people to know why they are being redirected to a different page you could simply set the redirection time to 1 second. In that case I would probably use IIS to redirect the page, especially if I am redirecting a site.

  • Facebook
  • Twitter
  • Linkedin

Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar