Site Redirection

Redirection is taking traffic for a given website and redirecting that traffic to another. In this example, we’ll place this index page in the web directory for http://www.krypted.com on an OS X Lion server. The server runs a site for https://www.krypted.com already and so this page is simply meant to redirect users to the https version of the site:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD> 
<TITLE>krypted.com Secure Redirect</title>
<meta http-equiv="REFRESH"
content="0;url=https://www.krypted.com"> 
</HEAD> 
<BODY> 
You will now be redirected to https://www.krypted.com
</BODY> 
</HTML>

Above, we create an HTML tag, a heading tag, a title tag, and finally the meta http-equiv refresh. The content used between the body tag is simply to inform a user who might happen to see this site what is happening. Simply copy this into an HTML file and you’re off to the races. If using OS X Server, you can drop into /Library/WebServer/Documents by default to redirect users elsewhere.

Get Using Mac OS X Lion Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.