301 redirect in PHP
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newdomain.com/page.html");
exit();
?>
301 redirect in ASP (only microsoft web servers)
<% response.Status = "301 Moved Permanently" response.addheader "location", "http://www.newdomain.com/page.html" response.end %>
301 redirect through mod-rewrite in your .htaccess file
RewriteEngine On RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
