301 Reasons To Redirect
One thing about being a website developer that can begin to drive anyone crazy is the demands that people make, based on some other website/developer who is hyping some technology/hack that they believe will make their site better/appear higher in page ranking.
An old SEO technique, that used to work, but is now dead in my book, is 301 Redirects. The basic use of an URL redirect is to allow website owners to change an URL and forward the old URL to the new URL. The reason is to prevent 404 Errors, and to allow website owners to make website changes, and still have the users bookmarks function.
What happened, was people realized, if the had a page that had a high-ranking in a search engine, they could sell that location, using a redirect to another site. Then the user with the other site would essentially have a high-ranking in a search engine immediately. This worked, but not anymore.
Search engines had to get smarter, and now they check if the link that is returning in a search has a 301, and if so, to where, and if that new page is not similar enough, it loses ranking. Now you might say, similar enough? I would say I am not an expert on the subject, but the idea of purchasing some domain to redirect to your own to boost up your ranking is not the best method.
Anyway, if your clients, or you, are interested in it, here is how to set up the redirect on the original server. By the way, this also works for legitimate changes, like URL shortening, and domain moving, just in case you’re here for that. Some people might ask, what if I have an HTML only page, how can I redirect then? The answer is, you have to use the actual web server to do the redirect, I did not cover how to do that here.
(Languages are alphabetical.)
ASP
Below is the only content that you can have on the page, if you have automatic headers or footers, or anything like that, it will not work, this should be the entire page.
<% @ Language = vbscript %>
<%
Response.Status='301 Moved Permanently'
Response.AddHeader='Location','http://www.yourdomain.com/yourpage'
%>
ASP .NET
Below is the only content that you can have on the page, if you have automatic headers or footers, or anything like that, it will not work, this should be the entire page.
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.yourdomain.com/yourpage");
}
ColdFusion
Below is the only content that you can have on the page, if you have automatic headers or footers, or anything like that, it will not work, this should be the entire page.
<cfheader statuscode="301" statustext="Moved permanently">
<cfheader name="Location" value="http://www.yourdomain.com/yourpage">
JSP (Java) Redirect
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.yourdomain.com/yourpage" );
response.setHeader( "Connection", "close" );
%>
PHP
Below is the only content that you can have on the page, if you have automatic headers or footers, or anything like that, it will not work, this should be the entire page.
<?php
header('HTTP/1.1 301 Moved Permanently');
header('Location:http://www.yourdomain.com/yourpage');
?>
Ruby on Rails
def old_action
headers["Status"] = "301 Moved Permanently"
redirect_to "http://www.yourdomain.com/yourpage"
end