Showing posts with label 301 redirects. Show all posts
Showing posts with label 301 redirects. Show all posts

Sunday, October 17, 2010

List of Web Server Error Messages

Errors on the Internet, and those annoying error messages, occur quite frequently, and can be quite frustrating, especially if you do not know the difference between a 404 error and a 502 error. Many times they have more to do with the Web servers you're trying to access rather than something being wrong with your computer. Here is a list of error messages you might encounter while surfing the Web and their respective meanings to help you figure out just what the problem is:
200 If a page is missing, it's replaced with the custom error page.
302 If the page is missing, it's replaced with a temporary redirect to a custom error page.
301 Redirects errors to either a custom error page, or some other page in the site (i.e. sitemap, homepage or best guess).
400 Bad File Request, usually means the syntax used in the URL is incorrect (e.g., uppercase letter should be lowercase letter; wrong punctuation marks).
 401 Unauthorized  Server, is looking for some encryption key from the client and is not getting it. Also, wrong password may have been entered. Try it again, paying close attention to case sensitivity. 
403 Forbidden/Access Denied,  Similar to 401; special permission needed to access the site -- a password and/or username if it is a registration issue. Other times you may not have the proper permissions set up on the server or the site's administrator just doesn't want you to be able to access the site. 
404 File Not Found, server cannot find the file you requested. File has either been moved or deleted, or you entered the wrong URL or document name. Look at the URL. If a word looks misspelled, then correct it and try it again. If that doesn't work backtrack by deleting information between each backslash, until you come to a page on that site that isn't a 404. From there you may be able to find the page you're looking for. 
408 Request Timeout, client stopped the request before the server finished retrieving it. A user will either hit the stop button, close the browser, or click on a link before the page loads. Usually occurs when servers are slow or file sizes are large. 
500 Internal Error, couldn't retrieve the HTML document because of server-configuration problems. Contact site administrator. 
501 Not Implemented, web server doesn't support a requested feature. 
502 Service Temporarily Overloaded, server congestion; too many connections; high traffic. Keep trying until the page loads.
503 Service Unavailable, server busy, site may have moved, or you lost your Internet connection. 
Connection Refused by Host, either you do not have permission to access the site or your password is incorrect. 
File Contains No Data, page is there but is not showing anything. Error occurs in the document. Attributed to bad table formatting, or stripped header information. 
Bad File Request, browser may not support the form or other coding you're trying to access. 
Failed DNS Lookup, the Domain Name Server can't translate your domain request into a valid Internet address. Server may be busy or down, or incorrect URL was entered. 
Host Unavailable, host server down. Hit reload or go to the site later. 
Unable to Locate Host, host server is down, Internet connection is lost, or URL typed incorrectly. 
Network Connection Refused by the Server, the Web server is busy. 

Saturday, October 16, 2010

Sorting out Canonical Issues for SEO

Information on how to use Canonical link reference, and 301 redirects (permanent redirect) to fix duplicate issues in SEO

I am still surprised at the number of websites I come across daily with this problem. The following information is supplied to look at resolving this issue.

--------------------------------

Set the Canonical source reference, indicating the primary page where ranking is to be delivered if you have duplicate content, by including the following metatag. The following tag tells the SEs to treat the page that they are on as if it is a copy of the listed domain/page, and that all of the link and content metrics that the engines apply should technically flow back to that URL.

<link rel='canonical' href='http://www.domainname.com.au' />


Note: 301s carry cross-domain functionality, meaning you can redirect a page at domain1.com to domain2.com and carry over those search engine metrics. This is NOT THE CASE with the Canonical URL tag, which operates exclusively on a single root domain (it will carry over across subfolders and subdomains).

The “301 Permanent Redirect” is the most efficient and search engine friendly method for redirecting websites. You can use it in several situations, including:

    * to redirect an old website to a new address
    * to setup several domains pointing to one website
    * to enforce only one version of your website (www. or no-www)
    * to harmonize a URL structure change

--------------------------------

ASP Sites – 301 Redirect

<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”, “http://www.example.com/keyword.asp”
%>

--------------------------------

ASP Single Page 301 Redirect (a variation on the above)

This redirect method is used with the Active Server Pages platform.

<%
Response.Status="301 Moved Permanently"
Response.AddHeader='Location','http://www.new-url.com/'
%>

--------------------------------

ASP Canonical Redirect

The Canonical Redirect with ASP must be located in a script that is executed in every page on the server before the page content starts.

<%
If InStr(Request.ServerVariables("SERVER_NAME"),"www") = 0 Then
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www."
& Request.ServerVariables("HTTP_HOST")
& Request.ServerVariables("SCRIPT_NAME")
End if
%>

--------------------------------

PHP Single Page 301 Redirect

In order to redirect a static page to a new address simply enter the code below inside the index.php file.

<?
Header(“HTTP/1.1 301 Moved Permanently”);
Header(“Location: http://www.new-url.com/page.html”);
exit();
?>

--------------------------------

PHP Canonical Redirect

The Canonical 301 Redirect will add (or remove) the www. prefixes to all the pages inside your domain. The code below redirects the visitors of the http://domain.com version to http://www.domain.com.

<?php
if (substr($_SERVER['HTTP_HOST'],0,3) != 'www') {
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.'.$_SERVER['HTTP_HOST']
.$_SERVER['REQUEST_URI']);
}
?>

--------------------------------

PHP Sites – 301 Redirect: Add to .htaccess file

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
RewriteRule ^index.html$ / [R=301,L]

--------------------------------

Apache .htaccess Singe Page Redirect for Linux Servers

In order to use this method you will need to create a file named .htaccess (not supported by Windows-based hosting) and place it on the root directory of your website, then just add the code below to the file.

Redirect 301 /old/oldpage.htm /new/http://www.domain.com/newpage.htm

--------------------------------

Apache .htaccess Canonical Redirect for Linux Servers

Follow the same steps as before but insert the code below instead (it will redirect all the visitors accessing http://domain.com to http://www.domain.com)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

--------------------------------

Thursday, September 2, 2010

Comparing 301 redirects and the canonical url tag

The Canonical URL tag attribute
<link rel="canonical" href=http://www.yoursite.com/page>
is very similar to the use of a 301 redirect from an SEO perspective.

Effectively you are telling search engines that several pages should be considered as one ,which the 301 does, without actually redirecting visitors to the new URL.

Note however; a 301 redirect redirects all traffic (search bots and human visitors), the Canonical URL tag is just for the search engines to see, meaning you can still separately track visitors to the unique URL versions. As well, a 301 is a better indicator that multiple pages have a single, canonical source. The power of a 301 redirect is in its ability to carry cross-domain functionality, meaning you can redirect a page from one domain to another and carry over those search engine metrics. This is not something that you can do with the Canonical URL tag, which operates exclusively on a single root domain (it will carry over across subfolders and subdomains).