University of Southern California

ITS Information Technology Services

Server Redirects


A Redirect is an Apache directive (command) which maps one URL into another. The new URL is returned to the browser which attempts to fetch it again with the new address.

A redirect can be used to make a shorter or more logical URL for your web site. For instance, the School of Medicine pages are located on the keck.usc.edu server.

However, there is a redirect which maps the URL http://www.usc.edu/medicine to the actual URL. Try the link and watch the redirect URL be replaced by the actual URL in your browser's location window.

Root-Level Redirects

The above is an example of a redirect which occurs at the server root. For security reasons, root-level redirects can only be implemented by the USCweb administrators. Use the instructions at USC.EDU Website Addresses to request a root-level redirect. Note that redirects slow down the functioning of the entire web server, so not all requests are granted.

Pages must meet all criteria on the USC Web site checklist in order to be considered for a root-level redirect.

Policy

Although most web authors would probably like to have a root-level redirect for their site, many schools and divisions prefer that member departments always be identified as belonging to the larger unit. For this reason, USCweb administrators will check with the Authorized Signer of the division or school before assigning a root-level redirect.

Local Redirects

You can also use redirects within your own web site by placing redirect directives in a local .htaccess file.

Syntax: Redirect URLpath URL

As an example, in The Blue School there is an interdepartmental research group named Red. Red's web maintainer belongs to the Green department, so Yellow's web site was set up at http://www.usc.edu/schools/blue/green/red.

It's been decided that Red shouldn't be associated with just the Green department, so in the /www/schools/blue directory, the Blue School's web maintainer creates the file /www/schools/blue/.htaccess which contains the following directive:
Redirect /schools/blue/red http://www.usc.edu/schools/blue/green/red

Now the URL http://www.usc.edu/schools/blue/red will reach Red's web site.

In fact, since there is already a root-level redirect for the Blue School which shortens that URL to http://www.usc.edu/blue, Red's site can also be reached with the URL http://www.usc.edu/blue/red.

Last updated:
February 27, 2012

Web Publishing Documentation

The use of all USC computing resources is governed by the USC Computing Policies.