301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It's not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it's the safest option. The code "301" is interpreted as "moved permanently".
ColdFusion Redirect
PHP RedirectCode:<.cfheader statuscode="301" statustext="Moved permanently"> <.cfheader name="Location" value="http://www.new-url.com">
ASP RedirectCode:<? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.new-url.com" ); ?>
ASP.NET RedirectCode:<%@ Language=VBScript %> <% Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://www.new-url.com/" %>
JSP (Java) RedirectCode:<script runat="server"> private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://www.new-url.com"); } </script>
CGI Perl RedirectCode:<% response.setStatus(301); response.setHeader( "Location", "http://www.new-url.com/" ); response.setHeader( "Connection", "close" ); %>
Ruby On Rails RedirectCode:$q = new CGI; print $q->redirect("http://www.new-url.com/");
Hope this helps.Code:def old_action headers["Status"] = "301 Moved Permanently" redirect_to "http://www.new-url.com/" end



LinkBack URL
About LinkBacks





Reply With Quote

Bookmarks