protected function redirect($path)
 {
     // Construct the url parts
     $protocol = $_SERVER['HTTPS'] ? 'https' : 'http';
     $host = preg_match('%^http://|https://%', $path) > 0 ? '' : "{$protocol}://" . $_SERVER['HTTP_HOST'];
     $uri = rtrim($this->baseUrl(), '/');
     // Perform the redirect
     SH_Http::redirect("{$host}{$uri}{$path}");
 }
Beispiel #2
0
<?php

// Includes
require_once dirname(__FILE__) . '/includes/shp_http.php';
// Redirect
SH_Http::redirect('demo/');