Permanent 301 Redirect, using HTML and PHP

Oct 25th, 2009

Yes, its true. You can 301 redirect using META HTML tag according to Sebastian. He says, Yahoo and Google accept it as 301 redirect. Though, it must be least preferred method. Using server side script or Server redirect (apache) is preferred method.

HTML 301 Permanent Redirect:

<html>
<head>
<title> --Title --</title>
<meta http-equiv="Refresh" content="0; url=http://www.your-new-blog.com/" >
</head>
<body>
...
</body>
</html>

PHP 301 Permanent Redirect:

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.new_location.com/page.php");
die(0);
?>

In case you are getting Warning: Cannot modify header information, then you can follow the link.

.htaccess 301 Redirect:

Redirect 301 /oldloc.php http://www.newlocation.com/newpage.php

Share/Bookmark

 

Possibly Related posts:

blog comments powered by Disqus