By continuing to use this site, you agree to the storing of first- and third-party cookies on your device to enhance site navigation; analyze site, product, and service usage; and assist in our marketing and promotional efforts. Cookie Policy

 
Skip to Content

Redirect Template

A redirect page takes web visitors from one URL to another. The redirect template accomplishes this via a header (meta refresh-type) redirect and can be used to redirect web visitors from an outdated URL to the new page, from a short social media-friendly URL to the actual content page, or to track entry points to the page from different promotion campaigns.

The template provided below creates a folder at the root of the site with an index.html page inside it (e.g. http://www.college.edu/signup/index.html). Even if the web visitor navigates to the extensionless URL (e.g. http://www.college.edu/signup), the index page is loaded by default. Then, the redirect in the HTML head of the page sends the web visitor to the desintation page (e.g. http://www.college.edu/admissions/recruitment/signup/index.html).

Uploading the Template FilesLink to this section

  1. Download the redirect-template.zip, which contains 3 files: redirect.tcf, redirect.tmpl, and redirect.gif.
  2. Navigate to the appropriate folder where your OU Campus template files are stored. This is typically /_resources/ou/templates but is specific to each implementation. (If you are unsure where your template files are stored, check the location in SetupSitesSite Settings > Production Server FTP Settings panel > "Template Directory" field.)
  3. Upload the zipped template files using zip import.
  4. Open the redirect.tmpl file in the source code editor.
  5. By default, this template creates a redirect without any set delay. A delay in seconds can be added by changing the numerical value of the content attribute on line 8, e.g. content="5". If you do add a delay, it's recommended to adjust the text in the <body> to provide a message to web visitors.
  6. Save and close the file.
  7. Open the redirect.tcf file in the source code editor.
  8. If your production server uses a default file name other than index.html (e.g. index.php, default.asp, etc) you will need to update the default file name. If this is the case, then update the filename attribute on line 29 and extension attribute on line 30 as appropriate. For example, if the web server is configured to serve default.asp, then the filename be changed to "default" and the extension be changed to "asp".
  9. Save and close the file.

Using the TemplateLink to this section

 If you have template groups set up, you may need to add the redirect template to a group so it is available for you and your content editors.

  1. Navigate to Content > Pages.
  2. Select the green +New button.
  3. Choose the "New Redirect" template.
  4. In the "Destination File" field, select the destination page you want web visitors to end on.
  5. In the "Redirect URL" field, name the folder to contain the redirect page. This will become the URL for the redirect page (e.g. enter give if you want your redirect URL to be http://www.college.edu/give/).
  6. Click Create. You will be taken to the edit view of the new redirect page which shows the redirect in action and ends on the Destination File.
  7. Click on Source to verify the redirect source code is correct.
  8. To make this redirect live, click Publish.
  9. Navigate to the URL on the production server where the redirect was created to verify that the redirect is working correctly.

Updating a RedirectLink to this section

Should you need to modify an existing redirect, you can:

  • To update the redirect URL, renaming the folder containing the redirect index page. Be aware that anyone using the previous redirect URL will see a 404 error if they go to that original URL. 
  • To update the Destination File, edit the redirect index page's source code. Update the URL attribute on line 8 with the new destination. Republish the redirect page to make this change live.

After any change, navigate to the live redirect page URL to verify the redirect is working correctly.

If your redirect URL is featured in print media (such as posters or brochures) then avoid renaming the folder containing the redirect. You can always create a second redirect page, with a different redirect URL, pointing to same destination page if needed. This will prevent 404 errors at the original redirect URL.

.htaccess RedirectLink to this section

On an Apache web server, the .htaccess file at the site root can be modified with 301 redirects. Use the following lines to make sure the rewrite module is configured:

Options +FollowSymLinks
RewriteEngine on

Then for each redirect, specify first the site root-relative URL you want to redirect from, and then the destination URL. E.g:

Redirect 301 /redirect.html http://gallena.edu/about/index.html

web.config RedirectLink to this section

On an IIS web server, the web.config file at the site root can be modified with 301 redirects. Due to the variations of IIS versions, it is best to consult the IIS documentation for your specific version on how to add 301 redirects into the web.config file.