seo snippets

Check which of your pages are in the Google supplemental index a.k.a Google hell

Tagged seo, google, robots.txt, noindex, follow  Languages 

Try this query to find pages that are in Google's supplemental index (trick invented by Bruce Clay, Inc):

-site:aktagon.com/* +site:aktagon.com/

The query should list all of your pages that are in Google's supplemental index a.k.a Google hell. These pages lower your Google page rank, so you should tell Google not to bother indexing those pages. This can be done with robots.txt:

User-agent:*
Disallow: /tags/*
Disallow: /archive/*

Another way of doing it is to add a meta tag:

<meta name="robots" content="noindex,follow"/>

This tells search engines to read the page but not index it.

And, be careful with what you put in robots.txt...

How to submit your sitemap to multiple search engines

Tagged seo, sitemap, google, search  Languages 

To submit your sitemap to search engines—at least Google, MSN and Yahoo support this feature—add this line to your robots.txt file:

Sitemap: http://aktagon.com/sitemap.xml

This allows the search engine to find your sitemap when it visits your site, which means you don't have to manually register it with each search engine.

How to improve your PageRank with 301 permanent redirects when using Nginx

Tagged seo, www, 301, permanent, nginx, redirect, rewrite, module  Languages 

Mathew Innman of seomoz.org fame wrote about how Digg could increase their revenue by using a so called canonical URL for their whole site. This can be implemented by redirecting users that type in, for example, www.digg.com to digg.com. The reasoning being that instead of having backlinks pointing to two different domains (www and no-www), all backlinks should point to just one, which increases your search engine ranking.

if ($host ~* "www") {
      rewrite ^(.*)$ http://aktagon.com$1 permanent;
      break;
    }

Permanent redirects are also a good idea, if you move your content to a new domain--digg.com to dugg.com, for example...

The syntax for the Nginx rewrite module is documented here.

A simple image replacement technique for increased usability and SEO ranking

Tagged css, image, replacement, usability, seo  Languages css

This is currently my favorite image replacement technique. I don't remember where I found it... Using it can improve both your site's usability and your search engine ranking, by allowing both screen readers and search engines to find your h1 headlines. First create the h1 and the description of your page/site, for example:

<h1 id="logo">Viagra, Botox, you name it</h1>

Then create the CSS rule for the page title:

h1#logo {
  text-indent: -9000px;
  background: url(logo.gif);
  width: 200px; /* Width of image */
  height: 50px; /* Height of image */
}

People using a modern browser that support CSS will see your logo (the image), and search engines and people using less modern browsers will see the content of the h1 header tag.

Note that if you replace the text of a link then use the outline CSS property to remove the dotted border:

.text-replacement {
    text-indent: -9000px;
}

.text-replacement a {
    outline: none;
}

How to optimize your MephistoBlog powered site's search engine ranking (SEO for MephistoBlog)

Tagged seo, mephistoblog, meta, google, search, keywords  Languages 

At Aktagon we use MephistoBlog as CMS, and I couldn't find any information on how to SEO optimize MephistoBlog on Google, so I'm sharing my notes here.

This tip shows you how to make your pages more search engine friendly.

First, add the title tag, plus the meta description and keywords tags to your layout's Liquid template , as shown here:

<meta name="description" content="{% if article %} {{ article.excerpt }}  {% else %} YOUR DEFAULT SITE DESCRIPTION {% endif %}" />
    <meta name="keywords" content="{% if article %} {% for tag in article.tags %}{{ tag }}, {% endfor %} {% endif %} YOUR DEFAULT KEYWORDS" />
    <title>{% if article %} {{ article.title }} &raquo; {{ site.title }} {% else %} {{ site.title }} &raquo; {{ site.subtitle }} {% endif %}</title>

Remember to update the default description and keywords in the meta tags' body.

Now, whenever you publish an article, simply add an excerpt and some tags to it. The excerpt is used as the meta description and the article's tags as the meta keywords, both make Google a bit happier, but the description is by far the more important.

How to SEO optimize your Rails URLs and routes

Tagged seo, rails, routes, permalink, crawlability  Languages ruby

My idea for achieving optimal content crawlability and SEO optimized URLs is to use permalinks instead of ids and the default Rails routes. The permalinks can contain whatever you decide is optimal from a SEO point of view.

As an example, let's take a recipe site that has a recipe at http://xxx/recipes/asia/china/beijing-duck.html.

First let's configure the .html extension to be handled by the RecipesController:

map.connect 'recipes/*permalink.html', :controller => 'recipes', :action => 'show'

In the code we use the URI, which is the permalink of the recipe, to retrieve the recipe from the database:

class RecipesController
  def show
    @product = Recipe.find_by_permalink(request.path)
  end
end

To handle the categories and subcategories, we use the following route:

map.connect 'recipes/*permalink/', :controller => 'categories', :action => 'show'

And create the CategoriesController:

class CategoriesController
  def show
    @category = Category.find_by_permalink(request.path)
  end
end

Now what's left is for you to figure out how to generate the permalinks... I recommend having a look at permalink_fu.

SEO optimized image URLs with the Paperclip Rails plugin

Tagged paperclip, rails, ruby, plugin, seo, url  Languages ruby

Create config/initializers/paperclip.rb:

# http://wiki.github.com/thoughtbot/paperclip/interpolations
Paperclip.interpolates :to_param do |attachment, style|
  attachment.instance.to_param
end

In the model:

has_attached_file :image, 
                    :path => ":rails_root/public/images:to_param/:style/:basename.:extension",
                    :url => "/images:to_param/:style/:basename.:extension",
                    :styles => { :large  => "250x360#",
                                 :medium => "150x230#",
                                 :small  => "110x150#" }

Instead of URLs like:

/images/products/249/large/temp.jpg

You can get a URL based on, for example, a permalink as in the example above. In my case I get URLs like this:

/images/games/nintendo-wii/large/super-mario-galaxy.jpg

SEO optimizing CarrierWave URLs

Tagged seo, carrierwave, url, filename  Languages apacheconf
class ProductImageUploader < CarrierWave::Uploader::Base

  def store_dir
    "product"
  end

  def filename
    ext = File.extname(original_filename) if original_filename
    "#{model.name.parameterize}#{ext}"
  end
end

Localizing URLs and Rails3 routes

Tagged i18n, routes, rails3, url, seo  Languages ruby

If you need to support localized URLs in a Rails application, you have at least two plugins to choose from: * i18n_routing NOTE: doesn't seem to work with Rails 3.2.8 * rails-translate-routes

I recommend the rails-translate-routes plugin because it allows me to create exactly the URLs I need.

For example, if these are the localized URLs I need:

http://xxx.com/news
http://yyy.com/uutiset
http://zzz.com/nyheter