Monday, August 31, 2009

Redirect SharePoint Site to New Location/URL

If you have requirement to redirect SharePoint users to new URL. Here is the step by step approach on creating a site redirect using Content Editor Web Part (CWEP) and JavaScript:

Here is the approach:

Create a subsite or new site collection in the same server or in other server. Once your subsite or new site collection is ready, make the page simple by removing all existing web parts and follow the below mentioned steps.

1. Click on “Site Actions” > “Edit Page”

2. Add Content Editor Web Part (CEWP) to a zone of your choice by clicking on “Add a Web Part”

3. This will bring up “Add Web Parts – Webpage Dialog” windows

4. If you don’t see “Content Editor Web Part” expand “All Web Parts” and it’s usually under “Miscellaneous” section

5. Tick “Content Editor Web Part” and click on “Add” button

6. Add content to CEWP either by clicking “open the tool pane” link or edit > Modify Shared Web Part

7. The previous step will open the Web Part properties in the right pane of the page. Click on “Source Editor” button

8. “Text Entry – Webpage Dialog” Window will open with blank page

9. Add the following JavaScript to “Text Entry – Webpage Dialog” window and click “Save” button.

<Html>
<head>
<script language="JavaScript">
</script>
<meta http-equiv="refresh" content="10;url=http://servername:3333/.../[subusite]">
</head>
<body>
"Provide the Information you want to read the users"<a href=http://servername:3333/.../[subusite]>Click here to Continue>/a>
</body>
</html>

10. Users will be directed to the new URL in 10 seconds (in the above script it’s 10 seconds. This value can be modified by changing content="10 value based on the content to be read on the page.)

No comments: