Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There are two ways of creating a redirect:

  1. http://siteA.cornell.edu/url1Image Removed -> http://siteB.cornell.edu/url1Image Removed
  2. http://siteA.cornell.edu/url1Image Removed -> http://siteB.cornell.edu/url2Image Removed

In the first example any URL that ends with "url1" will go to "url1" on the new site.  In the second example any request to siteA will always go to "url2" on siteB.

A typical use of "1" type of redirect would be: http://myoldname.cornell.eduImage Removed -> http://newname.cornell.eduImage Removed where the content on "myoldname" and "newname" is identical.

A use of "2" type of redirect would be where you have a substantial amount of changes and you may want to redirect the user to a page that alerts them about changes, i.e. http://oldsite.cornell.eduImage Removed -> http://newsite.cornell.edu/welcome-oldsite-users.htmlImage Removed

Creating "1" Redirect

...

Make sure to have a trailing slash!

The ".htaccess" should be placed in the "DocumentRoot" of the site. This is typically the same directory that would contain the "index.html", "index.cfm", "index.php", etc... that contains the content of http://siteA.cornell.edu/Image Added.

Create "2" Redirect

This is can be created by create a ".htaccess" file that contains:

No Format
RewriteEngine On
RewriteRule .* http://siteB.cornell.edu/url2

The ".htaccess" should be placed in the "DocumentRoot" of the site. This is typically the same directory that would contain the "index.html", "index.cfm", "index.php", etc... that contains the content of http://siteA.cornell.edu/Image Added.

More information