Redirects

 

Overview

Redirects, sometimes called 301 redirects serve two main purposes for your web site. First, it tells the search bots, Google in particular, that the page has moved and provides the new URL so that the listing in the search engine can be updated. This is the best, and possibly only way that you can update those bad links indexed in Google! Second, having the proper redirects established makes it so that if a user requests a URL that no longer exists (perhaps they had it bookmarked in their browser) they will not get a 404 page not found error. Instead of the error, they are transparently redirected to the new location.

Most often, links get broken when you design a new web site, switch hosting providers or even delete a page from your web site. In many cases, old links that were bookmarked by users or perhaps used in your marketing promotions are no longer valid after you've produced a new web site. The 301 redirect is the key to making it so those old links still work for people and at the same time, update the search engine indexes. The Redirect Manager is a tool in the CMS that empowers you to manage 301 redirects easily and efficiently.

 

Best Practices

Redirects are best used at a minimum. Ideally, important pieces of content that have moved locations can be given redirects so people with bookmarks or print pieces with URLs in them still work. Just because a page is deleted in Campusuite doesn't mean a redirect needs to be made for it. However, if your page has been indexed by a search engine, it's better to add a redirect so the search engines don't see broken links on your site, and hence adversely affect your higher rankings.

If you are migrating a site to Campusuite, it is suggested that you make redirects only for the necessary pages, and that you utilize wildcard redirects as much as possible. If you try to make a redirect for every page, you'll end up with a list of thousands of redirects and they will be hard to manage once you import them.

Your site's navigation is always up to date, so people can still use that to find content. Many sites contain a search function, so people can always search for what they need. As such, obscure pages that may have rarely been bookmarked or have not been used in past publications probably do not need redirects. The Redirect Manager will keep track of how many times a redirect has been used, and the date/time of when it was last hit.

Consider the following scenario to see how redirects can be used:

At a college, the marketing department just had thousands of nice, high-quality postcards printed up to mail out. Everything is ready to be mailed when somebody finally notices that the URL is wrong. Instead of "/about/Contact-Us.cfm", the dash in the "Contact-Us.cfm" part was left out! Basically, a lot of time and money has been potentially wasted on postcards that have the wrong URL on them.

Historically, a web manager would go out and rename, or worse, duplicate the "Contact-Us.cfm" to "ContactUs.cfm." If you renamed the page, you may be causing a broken link elsewhere on your site... and if you duplicated the page, you now have duplicate content to manage.

The ideal solution is to implement a 301 redirect, setting the wrong path (what was printed on the postcard,) to the correct path. When someone types in the path from the postcard, before the CMS throws "404 Not Found" error, it will search to see if a redirect exists in the Redirect Manager. If it finds it, it routes the person to the new page. In just a few seconds, you solved a problem that could have cost thousands of dollars and many hours of peoples' time.

This is a rather simple example of the usefulness of redirects, but it is a great one that shows how crucial the feature can be. We'll provide more examples below.

 

The Redirect Manager

The Redirect Manager can be found by selecting the Settings tab from the dashboard. It's only visible to Administrators. Then you will select the sub-link Redirect Manager. This tool will allow you to;

  • Add Redirects. Selecting this will allow you to add a new 301 redirect link pair.
  • Delete Redirects. This will allow you to delete existing redirects. Using the checkboxes, you can perform bulk actions.
  • Select All. This will select all of the currently visible redirects on the page.
  • Clear Selection. This will clear all selections when you have specific items checked.
  • Import from CSV. This will allow you to import a prepared set of link pairs in the proper CSV format.
  • Filter. The redirects can be filtered to show those starting with a particular letter or number.  This helps when you have a lot of redirects in the system.

 

What is a URL?

A URL is basically a pointer to some content on a web server. It could be a web page, an image, a PDF document, etc. URLs come in the form of:

[protocol]://[host]/[path]?[query]#[anchor]
Example: http://www.yourdomain.com/about/history.cfm#beginning

An "absolute" URL follows the above pattern. A "relative" URL (something that is on your site and points to something else on your site) omits the protocol and the host (as this information is already known and would be redundant,) and so looks something like this:

/[path]?[query]#[anchor]
Example: /about/history.cfm#beginning

  • Protocol: For web links, this is always either "http" or "https". The protocol is always followed by "://".
  • Host: This is the address for the main site, such as "www.campusuite.com".
  • Path: This is location of the requested item, usually some sort of folder/file path, and is always preceded by a "/".
  • Query: This is used only in special cases, and is preceded by a "?". Some web pages use this extra information to process the page.
  • Anchor: This is used only in special cases, and is preceded by a "#". Some web pages use these to jump to a particular part of the page when it is loaded. The redirect tool cannot use this piece of the URL, it is never sent to the web server; it is kept by the browser and is used locally when the page loads.

 

Logic of the Redirect Manager

If a URL is requested in your web site that would otherwise show a 404 page not found error, the system will look in the Redirects Manager to be sure there are no exceptions before throwing the 404 page not found error

When you add or edit a redirect, you have to specify two paths. We refer to these as "link pairs." The manner in which you specify the links for each determine how the redirect will function. Unless you are linking to a URL that is not on your web site, all URL's or paths that you specify should be relative. That is, they should begin with a slash "/" so that your web site domain is NOT part of the path.

Let's look at some examples:

File redirect: If you provide a path to a single file for the old path, then it will redirect to the new path entry.

Old path: /academics/c-science.htm
New path: /academics/computer-science.cfm

 

Directory redirect: The same can be done with a directory. Any time a person would access the old path below, they would be taken to the new path. If they requested a path such as "/academic/some-page.cfm", no redirect would happen. To do something like this, you would need to use a whole directory redirect using a wildcard.

Old path: /academic/
New path: /academics/

 

Whole directory redirect: Using a wildcard (*) as the last character in a path will attempt to perform a redirect for any file that is under that directory. Assume we have the following redirect in place:

Old path:  /academic/*
New path:  /academics/

This redirect would redirect any file requested that starts with "/academic/" to the absolute path of "/academics/". So, this would match "/academic/some-file.cfm" and even URLs like "/academic/some-sub-folder/some-file.cfm".

 

Whole directory redirect with file mapping: You can also redirect whole directories to a new location while keeping the filename intact. This is done by using a wildcard (*) at the end of the new path as well:

Old path:  /academic/*
New path:  /academics/*

This would redirect a path such as "/academic/some-file.cfm" to "/academics/some-file.cfm". This keeps you from having to create a redirect for each file in a directory; the wildcard (*) can be used to sum multiple rules into a single one. This can also be done to forward such files to an external web site:

Old path:  /academic/*
New path:  http://www.someothersite.com/academics/*

 

Wildcards

Wildcards are specified by using the asterisk (*) character. These characters can only appear in the "path" portion of the URL, and must always come at the end. These wildcards must also be preceded by a "/" when used. Here are some examples of how NOT to use wildcards:

  • /academics*: There is no "/" before the wildcard, this will do nothing.
  • /academics/*.cfm: The wildcard does not come at the very end, this will do nothing.
  • /academics/file.cfm?param=*: The wildcard is used in the query portion of the URL and not the path.

A proper use of the wildcard looks like:

  • /academics/*: The wildcard is used at the end of the path, and is preceded by a "/".
  • http://www.somesite.com/some-path/*: Wildcards for external URLs is supported, as long as it follows the other rules.

To learn more about how and when to use wildcards, read the "Logic of the Redirect Manager" section above.

 

Redirect Loops and Duplicates

It is possible to create never-ending loops with redirects. Suppose a redirect is made that goes from A to B. Later, somebody else makes a redirect that goes from B to A. If someone would access URL A, they would be redirected to B, which then redirects them back to A; this process would, technically, continue forever.

Most modern browsers detect this kind of looping and will stop redirecting once it notices such a loop. Some bots or other programs may not recognize these loops. As such, the redirects tool will prevent loops from being inserted into it. These are the rules generally followed when trying to add or update a new redirect in the system:

  • If the old path is similar to any other old path in the system, the redirect cannot be inserted or changed. This largely prevents duplicates from being entered.
  • If the new path is similar to any old path in the system, the redirect cannot be inserted or changed. This largely prevents loops from being entered.

A "similar" path means wildcards are checked when making these comparisons. For instance, "/academics/sub-folder/" would be similar to "/academics/*", since the wildcard would also cover the "sub-folder" part of the other path.

 

Link Pair Options

Let's review the format in which you will add old and new paths when you are adding or editing a redirect.

Old URL

The old URL is always a relative path, so must start with a "/" and never anything else. After all, you are redirecting a local file that is supposedly on your web site now. The path can be to a directory such as "/about/" or to a file such as "/about/contact.cfm", and it may make use of a wildcard.

New URL

You have three basic options for the new URL:

  • Relative Directory: A directory/path within your site. This path must begin with a "/", and no portion of the path can have a period in it (such as "/relative/path/").
  • Relative File: A file within your site. This path must begin with a "/", and the last portion of the path must have a period somewhere within it (such as "/relative-path/file.cfm").
  • Absolute External Link: A link outside of your web site domain. This must include the protocol and host of the external web site (such as "http://www.google.com").

 

Importing/Updating Bulk Redirects

Administrators have the option of importing multiple redirects into the system at one time using a bulk import file. Redirects are saved in a structured CSV (comma-separated values) file and imported via the Redirects Manager.

A CSV file is a very basic file, and most spreadsheet applications can export directly to a CSV file. You are free to save your data in any format while you are working on compiling your redirects, however, you will need to export that file to a CSV once you are ready to import.

At a minimum, the following fields are needed (a "label" in a CSV file is the first row of the document):

  1. A column with the label "Old Path".
  2. A column with the label "New Path".

Other columns can be present, but will be ignored. It is suggested, however, that you do not use additional columns as this could lead to more errors with the import. Again, we recommend downloading and using our template for your redirects. We have also provided a few examples of how the values should be within.

Click here to download our template.

The old and new paths specified in the CSV must still follow the rules for redirects explained earlier. Those redirects not following these rules will be ignored. Any redirects that were not imported will be shown to you when the process is complete.

When a CSV file is imported, it will update any current redirects that match an old path currently in the system. This prevents duplicate redirects, and keeps Administrators from having to check for already existing redirects.

To import a CSV file of redirects:

  1. At the top of the screen, click the Import from CSV button.
  2. This opens a popup and asks you to browse your computer for the CSV file. Click the button to Browse for a file, and select one.
  3. Click the Upload button to begin the process. You should see a busy animation while the import is being processed.
  4. If no errors occur, this popup will close when finished, and the screen will refresh to show the latest redirects. If some redirects did contain errors, and so were not imported, you will see a popup listing out these redirects. When finished with this screen, click the Close button to exit.

 

Adding a Redirect

Before you can add a redirect you must have the old URL and the new URL. (Please note: The two URL's must be different)

  1. Select Add Redirect
  2. Enter Old Path
  3. Enter New Path
  4. If both are accepted you will see a green check for both meaning that are valid redirects.
  5. Submit or Cancel

You will see the information displayed in the list providing the Old Path, the New Path, and the date and time of the addition.

 

Deleting Redirect

You are able to Delete redirects as a single entry or multiple entries using the bulk functions.

  1. From the main Redirect Screen, check the item(s) to be deleted.
  2. Select Delete Redirects button at the top.
  3. You will be shown what is being Deleted and asked if you want to continue.
  4. Select Yes or No. Yes will complete the action, No will return you to the menu where the item will still be checked. You must select Clear Selections to clear it.

The above process will work for single or multiple entries. You also have the option on a single entry to select Delete Redirect to the right of the entry. The process will follow the same steps as above.

 

Change Redirect

If a Redirect already exists you have the ability to Change it.

From the main Redirect Manager page

  1. Select the Change Redirect button to the right of the redirect you want to change.
  2. The Old and New paths are automatically populated.
  3. Revise the paths as needed.
  4. Select OK or Cancel.
  5. OK will process the change and return you to the previous menu.
  6. Cancel will cancel the process and return you to the previous menu.

You will see the information displayed in the list providing the Old Path, the New Path, and the date and time of the last change.