03 May, 2013

Redirect a SharePoint site by using the Content Editor Web Part - SP2010

Today one user came up with the requirements that he wanted to redirect his current site to different site collection. This seems to a normal requirement for everybody and can arise at any time.

I have resolved that issue with the use of metatag and thought to share with all of you as how I resolved it.

Please refer the following the following line of code that you need to use it for the redirection purpose.

<meta http-equiv="refresh" content="2;URL=http://sharepoint2007/sites/contentmodification">




Where you need to use it?
-Open the site where you need to set up the redirection
-site actions
-edit page
-add the content editor WebPart
-Give the reference of this file.

You must be wondering what is meant by reference?
-Created any document library or use the existing one
-Copy the redirection script/line in a notepad
-Upload this notepad in a document library
-click on the notepad direct and copy the link from the browser.
-Go back to the site where you have added the content editor WebPart
-Enter the link inside the WebPart which will take the reference of that notepad.

That’s it. You are done with redirection.

If you have any queries/questions based on the same then please let me know, Thank you.

13 comments:

  1. It works for me, Thank you!

    ReplyDelete
  2. Thank you 4 sharing this script. I have implemented the same in one of my requirements and works like a charm!! Would like to appreciate the descriptive information that you published as it helps me to understood it very thoroughly...Keep posting such wonderful articles....

    ReplyDelete
  3. amazing article, good job Amol!

    ReplyDelete
  4. Thanks for a great article. There so much confusing information on the internet mainly from people who have not done what they are talking about. It is good to hear from someone who is actually ‘walking the talk.’ Thanks again.
    Web content editor

    ReplyDelete
  5. This doesn't work in 2013. It seems like embedded meta refresh simply doesn't work. You can perform an immediate redirect using javascript but that does help people who want to perform a delayed redirect.

    ReplyDelete
    Replies
    1. Thanks for the info! this will surely help people to use the javascript.

      Delete
  6. Thats good one, however if we wanted to revert back the changes what is the best practice? as we set 2 Sec timeframe only? - Thanks Santosh Karne

    ReplyDelete
    Replies
    1. Thanks Santosh :) revert back is easy, access the webpart, make the changes and you are done!

      Delete
  7. Nice to talk over here Amol, as we set only 2sec to redirect the page i dont think we can perform the below actions in 2sec to revert back the changes. Go to sa-->edit page-->choose webpart -->modify webpart-->modify the changes.
    hope you got my hint.. sorry correct me if i'm wrong.. Thanks Santosh

    ReplyDelete
    Replies
    1. Santosh,

      -Please take the site URL in notepad, append it with ?contents=1
      -Remove that webpart
      -make the change again as per your requirement
      -add the webpart on any page where your requirement is.

      I hope this is clear enough to guide you further. Thanks

      Delete

Your feedback is always appreciated. I will try to reply to your queries as soon as possible- Amol Ghuge

Note: Only a member of this blog may post a comment.