Redirecting UNC web sites

Why would I want a redirect?

  • You are moving your site (from www.unc.edu to sites.unc.edu) and want to send traffic to the new site automatically.
  • You would like a shorter address for your site.

Where is my website hosted?

  • If  your site’s address starts with http://www.unc.edu, it is on the www.unc.edu servers. See the instructions below.
  • If it includes web.unc.edu or sites.unc.edu (e.g., mysite.web.unc.edu), it lives in WordPress. See the instructions below.
  • If it starts with anything else, it is hosted elsewhere at UNC. See the instructions below.

If your website is hosted on the www.unc.edu servers

  • Create a file called “moved.html” in the public_html directory containing your website. The below code will show viewers the new address, provide a link, and also redirect them automatically after 60 seconds. Change the paths accordingly.
<html>
  <head>
   <title>We've Moved</title>
   <meta http-equiv="refresh" content="60; http://new.server/path/to/new/site/">
   <style type="text/css">
     <!--
       body { margin-left: 15%;
              margin-right: 15%; }
       a         { color: Blue;   text-decoration:none; }
       a:link    { color: Blue;   }
       a:visited { color: Green;  }
       a:hover   { color: Red;    }
     -->
   </style> 
  </head>
  <body>
      <h2>This site has moved.</h2>
      <h3>The site has moved to a new location.
      Please update your bookmarks with the new address:</h3>
      <h2><tt><a href="http://new.server/path/to/new/site/">http://new.server/path/to/new/site</a></tt></h2>
  </body>
</html>
  • Test this new page by pointing your browser at it.
  • Once you have verified that the redirect page works, create a file called “.htaccess” in the public_html directory containing your website. The below code will send all traffic to your site to the moved.html file you created above, which will in turn redirect then to your new site. Change the path to the path to your site. See the htaccess FAQ for more information.
Options +FollowSymLinks
RewriteEngine On
RewriteBase /path/to/your/public_html
RewriteCond $0      !^moved.html
RewriteRule ^(.*)$    moved.html

If your site is in WordPress

If your site is in WordPress and you need to redirect traffic elsewhere, here is a help document on setting up redirecting in Word Press.

If your site is not on the www.unc.edu servers or WordPress

In this case, you will need to file a Memorandum of Understanding (MOU) with the IT Services Networking group. For more information on the MOU, please see this help document.

The form for submitting a MOU is located here: https://www.unc.edu/ipsforms/MOU_Dataform.php (Onyen and password required)