<?php

/*
	Copyright (c) 2012 Colin Rotherham, http://colinr.com
	https://github.com/colinrotherham
*/

	namespace CRD\Core;

	class Redirect
	{
		public function to($url, $permanent = false)
		{
			if ($permanent)
			{
				header('HTTP/1.1 301 Moved Permanently');
			}
		
			// Perform redirect
			header('Location: ' . $url); exit;
		}
	}
?>
<?php

/*
	Copyright (c) 2012 Colin Rotherham, http://colinr.com
	https://github.com/colinrotherham
*/

	namespace CRD\Core;

	class Redirect
	{
		private $permanent = 301;
		private $temporary = 302;
	
		public function to($url, $is_permanent = false)
		{
			// Which status code?
			$status = ($is_permanent)? $this->permanent : $this->temporary;
		
			// Perform redirect
			header('Location: ' . $url, true, $status);
			exit;
		}
	}
?>
Add proper status code param to redirects (for FastCGI's benefit)
Add proper status code param to redirects (for FastCGI's benefit)
