Archive for SEO

Understanding Web Page Redirection, the smart way

This article is intended to help you understand web page redirection and some of the technologies involved with doing so.

If you are looking for a more comprehensive guide to redirecting your page. Or if you are anxious for code samples on redirecting your page, then please reference this article: How to redirect a web page, the smart way.

What is Web Page Redirection?

Well, obviously this is simple, and not very complicated; redirecting a web page just means that you get transfered to another web page when accessing the current page or attempting to. That is pretty clear.

What isn’t clear — is that there are really at least 2 major different forms of web page redirection; Client-side Redirection & Server-side Redirection

Client-side

What is Client-side Redirection?

Well in this context, it’s your browser. More specifically: the contents of the web page your browser literally downloaded is the client (html). Because when you visit a web page, that page is downloaded and stored temporarily on your computer (also known as being cached).

Server-side

What is Server-side Redirection?

Basically, as a user visiting a web page — you can’t see anything that happens on the server-side.

This means that when a redirection occurs on the server-side, the only way you see it is that the original URL you were contacting suddenly changes to the new URL that the server-side is redirecting to. This is typically the best way to go about redirecting, because it is really the only “safe” way of communicating to a search engine “Hey, this page has been moved, here is the correct URL”

With that said, it is important to understand the different types of URL redirection. Ultimately, the redirection occurs when your browser or client is instructed of the redirection. My rule of thumb is to not ever redirect unless it is permanent. That doesn’t necessarily apply to everything, but it is a safe route.

The 301 redirect is really the only redirect I use, because it is intended to be a permanent redirect, and search engines recognize this.

What should I stay away from?

In short: Client-side Redirection. These methods of redirecting a web page range from using html meta tags, to javascript, and even using flash embedded on a page to redirect. All of these methods are notorious for getting you de-indexed from search engines, or at the very least, you’re page getting automatically penalized from search engines. Stay away from client-side redirection, unless it is user-initiated (like clicking on a link).

That pretty much sums it up. It is important to keep in mind that if you are trying to redirect your page, do some research to find out exactly which redirect is right for you.

Comments (2)

How to redirect a web page, the smart way

The internet today is full of webmasters that are always updating, editing and even deleting web pages.

Lets say you are updating your website completely, changing the names of page's filenames (ex: file.html to file.php) and so on, this is great, you should stay updated! But what if you want to get rid of those old pages without having to worry about those who go to the old web page and see nothing? It doesnt end there either, other visitors do include major search engines such as MSN, Google and Yahoo! If people are finding your old pages when querying in these search engines, and they attempt to go to that page that has been deleted or moved, they will get a "404 File Not Found" Error! Now i know you dont want that, no webmaster wants that!

UPDATE: For those of you still confused on what web page redirection is, I have written a follow-up article titled Understanding Web Page Redirection, the smart way, to help answer some of the questions I most commonly get in the comments of this article.

The 301 Redirect

The best way to redirect those pages is by using something called a "301 Redirect". What this 301 redirect does, is it blatantly redirects to a different page when it is triggered, what makes the 301 redirect the best, is that not only does it accomplish your redirect, it does it safely, no having to worry about the search engines penalizing you for it! To be specific, the 301 redirect tells the browser, or in other cases, it tells the search engines "Hey this page has been moved, here is the correct URL!". Think of it as you getting mail that is not addressed to your name, possibly addressed to somebody who has lived there prior to yourself, what do you do? You tell the post man (or woman) "Hey they dont live here anymore, here is the correct address". It is the same concept guys, pretty simple if you asked me!

So lets get started. Below you will see several methods of using the 301 redirect, including the redirect in PHP, the redirect in ASP, the redirect in ASP .NET, the redirect in JSP (JAVA), the redirect in IIS, the redirect in ColdFusion, the redirect in CGI/PERL and finally the one I find most useful, the redirect using htaccess. Also showing other useful ways of using the 301 redirect with mod_rewrite!

HTML Redirection

How do you redirect using html you ask? Here is how: DONT!

Over the past 4-6 years, use of meta tag refresh redirection has been abused for uses in relation to SPAM. The result of this and other scenarios of mis-uses of it, is that when using it, that page WILL be de-indexed from every search engine.

NOTE: This also applies to javascript redirection. Search engines can easily detect javascript and meta tag redirection, so just dont do it, use the 301 redirect.

301 Redirect Using htaccess

Using htaccess to accomplish the 301 redirect is highly suggested due to it being fairly convenient to manage, rather than setting redirects on each individual page, you can simply add the redirect code to the .htaccess file.

Here is how to do it:

  1. Create a file on the root directory of your website, name it ".htaccess".
  2. Open the .htaccess file using notepad or what ever text editor that you prefer.
  3. Add this into the .htaccess file, save it and then upload it to your web server:
    CODE:
    1. Redirect 301 /old/old.html http://www.you.com/new.html

NOTE: Don't add "http://www" to the first part of the statement - place the path from the top level of your site to the page. Also ensure that you leave a single space between these elements:

redirect 301 (the instruction that the page has moved)
/old/old.html (the original folder path and file name)
http://www.you.com/new.html (new path and file name)

Also note that you are not required to redirect the page to another domain, an equally useful purpose for using the 301 redirect, is redirecting old pages to the new pages on the same domain, it all works the same way!

UPDATE: .htaccess Editor is a simple, yet useful resource for generating htaccess files.

301 Redirect Using Mod_Rewrite

Mod_Rewrite has got to be one of the most usefull modules a server can have in terms of SEO, it allows to organize the file structure of your web site in a dynamic yet simple fashion, in this example I show a useful method of 301 redirecting with mod_rewrite.

When somebody links to your website, sometimes they dont always link to you in the way that you want them to. If somebody links to www.yoursite.com and somebody else links to yoursite.com, Google will assign a separate pagerank for each of those. Yes, it is stupid but it is true, by inserting the below example into your .htaccess file, it will solve the problem by redirecting anything linking to yoursite.com to www.yoursite.com, also redirecting the pagerank, so no worries!

CODE:
  1. RewriteEngine On
  2. rewritecond %{http_host} ^yoursite.com
  3. rewriteRule ^(.*) http://www.yoursite.com/$1 [R=301,L]

301 Redirect Using IIS

  1. In internet services manager, right click on the file or folder you wish to redirect.
  2. Select the radio titled "a redirection to a URL".
  3. Enter the page that the page will be redirected to.
  4. Check "The exact url entered above" and the "A permanent redirection for this resource".
  5. Click on 'Apply'.

301 Redirect Using ColdFusion

As well as many server side scripting languages, using the 301 redirect in them is fairly simple.

Simply add this code to your ColdFusion page:

CODE:
  1. <cfheader statuscode="301" statustext="Moved permanently">
  2. <cfheader name="Location" value="http://www.new-url.com/">

301 Redirect Using PHP

Simply add this code to your page or script:

PHP:
  1. <?
  2. header( "HTTP/1.1 301 Moved Permanently" );
  3. header( "Status: 301 Moved Permanently" );
  4. header( "Location: http://www.new-url.com/" );
  5. exit(0); // This is Optional but suggested, to avoid any accidental output
  6. ?>

301 Redirect Using ASP

Simply add this code to your page or script:

ASP:
  1. <%@ Language=VBScript %>
  2. <%
  3. Response.Status="301 Moved Permanently"
  4. Response.AddHeader "Location", "http://www.new-url.com/"
  5. %>

301 Redirect Using ASP .NET

Simply add this code to your page or script:

ASP:
  1. <script runat="server">
  2. private void Page_Load(object sender, System.EventArgs e)
  3. {
  4. Response.Status = "301 Moved Permanently";
  5. Response.AddHeader("Location","http://www.new-url.com/");
  6. }
  7. </script>

301 Redirect Using JSP/JAVA

Simply add this code to your page or script:

JAVA:
  1. <%
  2. response.setStatus(301);
  3. response.setHeader( "Location", "http://www.new-url.com/" );
  4. response.setHeader( "Connection", "close" );
  5. %>

301 Redirect Using CGI/PERL

Simply add this code to your cgi/perl script:

PERL:
  1. $q = new CGI;
  2. print $q->redirect(" http://www.new-url.com/ ");

301 Redirect Using Ruby/Ruby on Rails

(Thanks to Codeninja) Simply add this code to your ruby/ruby on rails script:

RUBY:
  1. def old_action
  2. headers["Status"] = "301 Moved Permanently"
  3. redirect_to "http://www.mynewpageorsite.com/"
  4. end

Pleaee note that all of the snippets of code above are examples and I have tested each at some point. However, I am in no way responsible for any damage the code may cause, you use this code at your own risk.

Comments (385)

Metadata; SEO for Flash

Before Flash 8, there was no standard for seo'ing a flash movie. There was, and still is limited functionality provided by major search engines such as google, for instance if you search "game filetype:swf" in Google, it will return some results perhaps relevant but not really accurate.

In Flash 8 there is something called "Metadata". Although, in my opinion standard html pages will always have the higher "value" in terms of being indexed well by search engines. But this is a good start for getting flash on the right track in terms of SEO for flash.

Within Flash 8, open the document properties and along with your usual document properties you will see the Title and Description Fields, that pretty much says it right there.

Flash 8 Metadata

One thing to keep in mind, and is what I tell everybody who asks me anything about SEO: Don't try to use meta fields to spam keywords. This applies to html with meta tags as well. This isnt 1999 any more and the search engines aren't stupid. So just put what best defines the flash movie and allow the search engines to gain accuracy, common sense really.

If you turn on size report generation (File > Publish Settings > Flash Tab > Generate Size Report) and then test your movie (CTRL + ENTER) you will see something like this in the report:

Metadata
--------
Bytes    Value
-----    -----
217    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/1.1/"><dc:title>My Flash Movie Title!</dc:title><dc:description>This is my flash movie's description!</dc:description></rdf:Description></rdf:RDF>

Keep in mind though, that because you included the meta information for your flash movie, this does not mean that it will automatically generate the meta tag information for your actual html page, this you will need to do separately. Although, in my opinion meta tags for html pages are no where near as vital as they once were and are more of an option.

Also another perk to using the metadata fields, is that you can publish the information for ANY version of flash player 8 or earlier. This means if you have a flash site compiled in flash 6 and just want to include the metadata, then go right ahead! You will need the corresponding .fla file and flash 8 to do this, but in the long run I think it is worth it.

Digg this!

Comments (1)

Flash & SEO, Good or Bad?

More and more people have been asking me questions about flash, and if it is SEO friendly.

Well the obvious answer is really in the question if you think about it: YES it is seo-friendly, in the sense that it does NOT harm any seo efforts on a website. However the goal of achieving a successful website in terms of seo and still use flash, well the things to consider and keep in mind are no special case for flash than it is for any other web application! CSS, your html coding, what you are doing server-side that might affect the html output, a huge list of other things as well! But in this scenario, lets stick to the topic of why flash will not harm your seo.

Google I believe currently can index a swf file, and per my tests only to a certain extent and the weight value granted to what is indexed in a swf file is no where near the importance of a standard html document. However in Flash 8 there is a whole API built that search engines will be building compatibility for. And I quote from Flash 8's feature list:

SWF Metadata
A new metadata property for the SWF file format improves searchability of SWF files by Internet search engines. Now Flash authors can add a title and description to a SWF file, allowing search engines to more accurately reflect the content represented by the SWF file.

Although this is huge advance for flash and SEO, this by no means gives flash the same SEO power as would a html document. But what is my point you may be asking?:) well! My point is (get ready for it, drum roll please?) don't put your textual content embedded into a flash movie. At least not yet anyways, we will see when this new flash 8 search engine api has been fully implemented into the major search engines. Until then, it is simple really - just continue naturally developing your web pages, web applications or whatever the case may be! That is the largest mistake any seo can make; thinking of unnatural methods in attempt to gain ranking in the search engines.

My main point here, is that flash does not under any circumstances harm your website for SEO, unless otherwise you are using flash to violate search engine guidlines (like using getURL to perform sneaky redirects for doorway pages, etc). But then again this refers to my above statement about how you should think naturally not sneakily! Don't fix something if it isnt broken, don't assume it's broken just be naturally observant.

An ideal website that uses flash and is seo-friendly, is one that has all of their textual content in html form and has all their promotional and attractive "portions" in flash, like a flash header for example!

A perfect scenario of a great time to use flash for your website is if the textual content of the website doesn't matter! Or at least does not matter to you, but then again if that is the case, then you are probably not reading this right now!

I should also mention that Google has some flash seo suggestions that I personally would only take if I were in the position that the flash website was already built. But none the less, it still helps to perform the task at hand; making flash seo-friendly.

I started in flash, that is my grounding and everything else that I have grown into came after that, even SEO. So as long as it is fact, I will be defending Flash on all acusations that flash is not seo friendly!

Comments (6)