Redirection

By Brandon on Feb 17, 2007

Redirection e.e

<?php
    if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
        $uri = 'https://'; / what?
    } else {
        $uri = 'http://'; / what?
    }
    $uri .= $_SERVER['HTTP_HOST'];
    header('Location: 'http://you_stuff/url.php'); // stick your url here
    exit;
?>

Comments

Sign in to comment.
DiGiTaL   -  Sep 15, 2008

Geez people do you guys test your shit before uploading it or just write and send it for no reason :/ What horrible code Here is an a lot easier to write this

 <?php  
      header("Location: http://siteurl.com");
 ?>
 Respond  
tye   -  Feb 26, 2007

What\'s the purpose of the $uri variable?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.