Redirect Page Template

Overview

The Redirect Page template can be used to provide a template for users that allows them to create a redirect from one page to another in OU Campus. A "short URL" provides a page with a refresh-type redirect in a designated directory. This template uses a header redirect and is designed to provide a way to be able to use shorter URLs in different media outlets where long URLs are not practical. This also allows a way to track entry points to a site in order to determine their success in various campaigns.

Redirect Page Template Icon

When using the template, the result is a folder created at the root of the site with an index.html page in it, e.g. http://www.college.edu/signup/index.html. However, the URL provided on materials such as flyers or in radio announcements would more likely be http://www.college.edu/signup. As this is a directory link, the index.html page in that folder is loaded by default, and then the redirect in the HTML head of the page sends the user to actual landing page, which is http://www.college.edu/admissions/recruitment/signup/index.html. 

Marketing metrics can be tracked by creating different redirects for each marketing outlet, such as radio, print, email, direct mail, or any other scheme that needs to be tracked in order to provide an understanding of the campaigns that are driving traffic to the site.

This template uses a http-equiv refresh as a meta tag in the header of a page for the redirect. This could also be used in lieu of manually managing 301 redirects in an .htaccess file.

Editing the Template Files

A Zip package is provided that includes a file set consisting of three files for the Redirect template.

  1. Download the following: redirect-template.zip
  2. Extract the .zip. This template consists of 3 files:
    • redirect.gif
    • redirect.tcf
    • redirect.tmpl
  3. Open the TMPL file in a text editor (such as MS Word, Notepad, or Pages).
  4. Locate the sample text: http://college.edu and replace it with the actual domain name of the institution. It is not required to include the trailing slash. This will be the prefix that is prepended to the target file for the redirect.
  5. Save and close the file.

The default in this template creates a page with a header redirect to the URL without any set delay. It could also be edited to introduce a delay of several seconds by changing the numerical value within the "content" attribute, e.g. content="5". Text could also be added to provide a message for the visitor. The header code in the TMPL may also be used  this way in a file without actually using the short URL part of the template, instead of a 301 redirect in an .htaccess.

It may also be necessary to edit the TCF file to specify the actual default file for a site if it is not index.html. For example, if the web server is configured to serve some default.asp, then the filename attribute of the template node can be changed to "default" and the extension attribute to "asp".

Note: Alternatively, the template file set may be uploaded directly to OU Campus and the files edited using the Source Editor.

Uploading the Template

If having edited the files locally, upload them to OU Campus, or just drag and drop the files into the proper location. Do not upload the .zip file, as OU Campus will be unable to access it. Instead, upload the three extracted files (redirect.gif, redirect.tcf, and redirect.tmpl) into the desired location. The templates directory is often located at /_resources/ou/templates, but is specific to each implementation, so the templates directory may be different.

Navigate to Setup > Templates to change the name of the template. It may also be necessary to add the new template to a template group and utilize the access settings to assign the template group to a directory or to the site root, which is typical.

Test the template by creating a new redirect page.

  1. From a Pages list view, click New, and select the New Redirect Page template.untitled
  2. In the Original File field select the HTML file to which the redirect will point. Make sure to select a file on the production server.
  3. In the Short Name field designate the name of the directory that will contain the index.html that has the redirect. This is also the URL that can be distributed.TCF Form for the New Redirect Page Template
  4. Click Create.

A notification should indicate that the new file was created. The file should also be automatically published. Visitors directed to that URL are automatically redirected to the file selected for the Original File field.

301 Redirect

For the Apache web server, 301 redirects can be used to redirect one page to another using the .htaccess file at the site root. Use the following lines to make sure the rewrite module is configured:

Options +FollowSymLinks
RewriteEngine on


Then for each page, use the site root relative URL and the complete URL for the page to redirect to /stalepage.html http://gallena.edu/about/index.html