Skip to main content

The SharePoint User's Toolkit

Go Search
Home
  
The SharePoint User's Toolkit > Pages > Page-Redirect  

Web Part Page Title Bar image
Page Redirect

 Select Your Options

Target location

Enter here the URL of the page the visitor will be redirected to.

Pop-up Message

A pop-up message will warn the visitor that a redirect is set up.

Timer

The redirect will only happen after the specified delay.

Inline Message

A message displayed at the top of the page will warn the visitor that a redirect is set up.

Current page content

Hide Show If you select the 'Hide' option, the current page content will be hidden.

You must have Flash 10 installed to activate the "save to disk" button.

Filename:
The code below is automatically updated according to the options you select.

 Installation

 

This script allows you to redirect your users to another Web page (specified in the Target location), when they try accessing the current page.

1/ Build your script

- Select your options (under the "Select Your Options" tab).

- Click on the "Save To Disk" button to save your script to your computer.

SaveToDiskIf you don't see the button, you'll need to copy and paste the script displayed at the bottom of the page.

 

- Upload the script to a SharePoint library in your site collection.

Recommended practice: to host your custom scripts, create a dedicated "Utilities" library at the top level of your site collection. Make sure all users have read access to it.

2/ Using the script

- at the top of the Web page where you want to place the redirect, add a Content Editor Web Part

- Edit the Web Part:
Under Content Link, enter the link to your script
Under layout, select the "hidden" checkbox

- click OK.

- Exit the Edit mode.

 Removal

 

Editing a page that includes a redirect action can be tricky, especially if you didn't include a timer: the redirect will occur before you have a chance to do anything on the page.

Here are three options:

- Edit the page before the redirect occurs, clicking on Site Actions | Edit Page. This will only work if you chose to include a timer and to keep the page content visible.

- The "contents=1" trick

If you append the "contents=1" querystring to your page URL, you’ll be sent to the maintenance page, where you can remove Web Parts. If for example your page URL is:
http://www.server.com/site/default.aspx

You can access the maintenance page via the following URL:
http://www.server.com/site/default.aspx?contents=1

- If you followed the installation instructions and placed the script in a separate .txt file - not directly in the CEWP - you can directly edit the .txt file to remove the redirect.

 ‭(Hidden)‬ EasyTabs

 ‭(Hidden)‬ Create Code

 ‭(Hidden)‬ Banner

 ‭(Hidden)‬ GA

Copyright © 2009-2010 Christophe Humbert