How to redirect to another page

, , , , , , , ,

The most efficient method for webpages redirection is 301 redirect. The code 301 means “moved permanently”. Here we have an example for php 301 redirect


<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-website.com" );
?>

The following php code redirects the user to /index.php within the same site:

<?  header('Location: /index.php'); ?>

Html Redirect

The following code must be found between the head tags of the page

<META http-equiv=”refresh” content=”5;URL=http://mywebsite.com”>


Comments are closed.