301 is an HTTP status code that basically instructs search engines and browsers that a page has moved, permanently. If you've changed a file name, domain, folder path, whatever, a 301 redirect will update the search engines. This ensures your content remains indexed and available via search engines.
PHP 301 Redirect Code
<?php Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.new-url-here.com" ); ?>
ASP 301 Redirect Code
<%@ Language=VBScript %> <% Response.Status="301 Moved Permanently"; Response.AddHeader("Location","http://www.new-url-here.com/"); %>
ASP.net 301 Redirect Code
<script runat="server"%> private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://www.new-url-here.com"); } </script>
Coldfusion 301 Redirect Code
<cfheader statuscode="301" statustext="Moved permanently"> <cfheader name="Location" value="http://www.new-url-here.com">
Perl 301 Redirect Code
#!/usr/bin/perl -w use strict; print "Status: 301 Moved Permanantly\n"; print "Location: http://www.new-url-here.com/page.htm\n\n"; exit;
In addition, javascript, meta refresh tags, and some web-servers even support redirection management via conf files. If there's a particular redirect you'd like to know more about but can't seem to find any information, post a comment and I'll do my best to provide some guidance.
Word Count: 241


