Web Hosting

The Web Hosting Community

Advanced search
  • HOME
  • TOP HOSTING
  • TOOLS
  • FORUM
  • WIKI
  • NEWS
  • English
  • Spanish
  • Hebrew
  • Forum ‹ Main Forum ‹ Programming Discussion
  • Change font size
  • Print view
  • FAQ
  • Register
  • Login

301 code / 301 redirect

Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Post a reply
2 posts • Page 1 of 1

301 code / 301 redirect

Postby talshk on Thu Aug 14, 2008 11:02 pm

After answering this question many times over the email, I have decided to post my suggestion through this forum. enjoy ;) .

A bit about 301 redirections - 301 redirect is the best and search engine friendly method to preform redirections. A 301 Redirection should preserve your search engine rankings for a given page. That happens because the "301 code" is interpreted as "moved permanently" and search engines should in most cases copy your old pagerank to the new page. It's not an exact science but it should work in most cases.

here are some examples for 301 redirections:
PHP:
Code: Select all
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.webhosting.com" );
?>


ASP:
Code: Select all
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.webhosting.com"
%>


ASP.NET:
Code: Select all
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
  {
   Response.Status="301 Moved Permanently";
   Response.AddHeader("Location","http://www.webhosting.com");
  }
</script>


JSP:
Code: Select all
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.webhosting.com");
response.setHeader( "Connection", "close");
%>


JSP:
Code: Select all
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.webhosting.com");
response.setHeader( "Connection", "close");
%>


that's about it. if anyone has questions, please use this forum to ask me.
tal.
talshk
Site Admin
 
Posts: 10
Joined: Sun May 04, 2008 11:06 am
Top

Re: 301 code / 301 redirect

Postby frank on Fri Aug 15, 2008 10:21 pm

hi tal,
Is it possible to use 301 redirects using plain HTML or Javascript?
thanks,
frank.
frank
 
Posts: 7
Joined: Thu May 08, 2008 3:23 pm
Top


Post a reply
2 posts • Page 1 of 1

Return to Programming Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

  • About Us
  • Privacy
  • Terms & Conditions
  • Web Host Login
  • List Your Web Host
  • Contact us
Copyright © 2007 HostPedia.org Web Hosting, All rights reserved, Forum powered by phpBB.
cron