Posted by mcurry on January 11, 2007 at 9:05pm
Here's my first pass at a 'checklist' for Drupal & SEO. I know some or all of this has been covered elsewhere, but I'd like to see a simple list. If a good one exists elsewhere, please provide a URL and we can just point to that.
For instance, what modules and configuration are 'must have' for SEO purposes? (I'll add links as time permits)
Suggested techniques
Strongly oriented towards search spiders & SEO
- Enable clean URLs (Admin setting)
- Create .htaccess rewrite rules for 301 redirect to canonical domain name (http://example.com or http://www.example.com)
Recommended Modules
- Global Redirect (redirect any URL to another URL via 301 or other chosen status)
- Path Redirect (prevent duplicate index entries by generating 301 redirects to friendly URL path)
- PathAuto or UrlIfy (simplify generation of URL paths rather than the default node/xxx URLs.)
- XML Site Map (formerly google sitemap)
- NodeWords (meta information)
Useful for both human visitors and search spiders
Recommended Modules
- Directory (present hierarchical, drill-down view of taxonomy terms)
- site_map (presents a 'site map'-style page
- Related Links (http://drupal.org/project/relatedlinks) OR Similar Entries module (http://drupal.org/project/similar)
- Search404
Social bookmarking sites (tangentially related to SEO, as social sites will create inbound links (IBLs) as well as drive traffic)
Recommended Modules
- Ping/Multiping
Keeping the site relevant/on-topic
- Node and comment moderation (what modules can help assist with moderation tasks?)
- Require admin approval on new user registrations? (We've been hit with a variety of spam user account attacks, so for now, we lock down registrations so we can review the new account email address to see if it's a likely spammer.)
Recommended Modules
- Spam/bad behavior or other module to prevent site pollution by spammers
Have I missed anything? Please help by suggesting your favorite technique.
Edit - 1/14/2007: Added NodeWords module to list.
Edit - 1/15/2007: Added Related Links and Similar Entries module to list. First pass at lumping suggestions into related categories
*Edit - 6/2/2007: Added Search404 to list of essential modules

Comments
.htaccess rewrite rules for
I put
<?phpif ($_SERVER["HTTP_HOST"] != 'example.com') {
header('HTTP/1.1 301 Moved Permanently');
header('Location: http:// example.com'. $_SERVER["REQUEST_URI"]);
exit;
}
?>
on the top of all my settings.php
this redirects www.example.com to example.com
http:// example.comthe space is there because of an error of the input formats (<?php-parser and the autodiscovery of links)Tobias Maier - http://www.tobiasmaier.info/
--
Switch to Firefox!
Steig auf den Firefox um!
mozilla.com
Tobias Maier - http://tobiasmaier.info/
Isn't this redirect better done in .htaccess?
I would do simple things like this in .htaccess to speed things up.
ChadJ
Ecommerce SEO Checklist
Experimental Website Monitor
ChadJ
Free Site Monitor
Keyword Marketing Ladder
modifying .htaccess
The existing code in the default Drupal installation .htaccess file is this:
RewriteCond %{HTTP_HOST} ^example.com$ [NC]RewriteRule .* http://www.example.com/ [L,R=301]
If I modify and enable this and check out the site, URLs such as "example.com/my/page" are redirected to "www.example.com". Obviously this is because of the rewrite rule. Is there any way of keeping the URL complete?
I ask only because, if someone suddenly discovers this information (use only one canonical domain name?) and changes these rules, all their linked-to content will bounce to the homepage. This cannot be a Good Thing.
Web Development in Nottingham, UK by Kineta Systems / Follow me on Twitter! @NikLP
.htaccess
Using:
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Will resolve request:
http://example.com/category/subcategory/page.html
to:
http://www.example.com/category/subcategory/page.html
This is a 301 redirect which should preserve backlinks and bookmarks.
Cool!
That's great, I thought it would be pretty simple to sort out.
Should we propose that this go into core? I don't really understand why it's not there already. The standard at the moment seems counter-intuitive (and counter-productive) really.
Web Development in Nottingham, UK by Kineta Systems / Follow me on Twitter! @NikLP
I don't know....
There is great debate as to whether to use the domain (http://example.com) vs sub domain (http://www.example.com). Forcing the www in core may cause issues for some sites. You would want to provide an option if you did.
Further to this...
I tried to implement the following but with limited success:
RewriteCond %{HTTP_HOST} ^example.co.uk$ [NC]RewriteRule .* http://www.example.co.uk/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule .* http://www.example.co.uk/$1 [L,R=301]
The idea was that all requests from all four possible "domains" would be redirected to the www.example.co.uk one, but it doesn't work. In fact, the new rule above (from Trinity) doesn't appear to do anything either. With the four rules above, requests work as follows:
http://www.example.com/about -> http://www.example.com/about (does nothing, incorrect)http://example.com/about -> http://www.example.co.uk (partially correct, but doesn't pass the url fragments)
http://www.example.co.uk/about -> http://www.example.co.uk/about (correct)
http://example.co.uk/about -> http://www.example.co.uk/ (doesn't pass the url fragments)
So the
$1thing doesn't appear to have done much.Also my attempts at redirecting the .com requests to the .co.uk seem to be fairly crappy. Ideas?
Web Development in Nottingham, UK by Kineta Systems / Follow me on Twitter! @NikLP
Try This...
Try this one and let me know how you make out...
Note: first two lines need only be in .htaccess once so if they already exist above the rewrite conditions and rules then they do not need to be repeated.
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.co.uk$ [NC]
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.co.uk/$1 [R=301,L]
Hmm
Unfortunately this doesn't appear to do much either... :(
http://www.example.com/about -> http://www.example.com/about (does nothing, incorrect)
http://example.com/about -> http://example.com/about (worse than before)
http://www.example.co.uk/about -> http://www.example.co.uk/about (obviously)
http://example.co.uk/about -> http://example.co.uk/about (worse than before - also sets another cookie as it doesn't redirect)
Also you missed out escaping the
.characters! ;) It should be^example\.co\.uk$I believe.Edit: I had to double-escape the dots as (presumably) the input filter stripped them out, presumably that's why.
Web Development in Nottingham, UK by Kineta Systems / Follow me on Twitter! @NikLP
Brain Fade....
Sorry about that. After thinking about it, it makes sense that it doesn't work.
You will need two .htaccess files.
The first is where your main or index page is located in the www.example.co.uk site and should read:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.example.co.uk/$1 [R=301,L]
For the example.com site place this in the htaccess file where your main or index page is located. This assumes that the file and directory structure remains the same on both sites and the difference is only in the domain name.
Options +FollowSymlinks
RewriteEngine on
Redirect 301 / http://www.example.co.uk/
Please let me know how you make out with these. I tested these on some of my sites and they worked.
Brain Fade II ...
Drupal is not showing the escape characters despite several attempts using several procedures so I will explain where they go below:
In the code provided in my previous post place a "\" character (without the quotes of course) in front of both periods in the ".co.uk" portion of the following line:
RewriteCond %{HTTP_HOST} ^example
.co.uk$ [NC] ?>Ha!
Oops, perhaps I didn't make it clear. Both the domains are pointing at the same site. There is only one. In which case, would this be a problem with one of the domains not being correctly pointed?
Web Development in Nottingham, UK by Kineta Systems / Follow me on Twitter! @NikLP
Registrar
If you only have one site (I'm assuming the .co.uk site) and the other .com site never existed, then for the .com domain go to your domain registrar account manager and perform a domain forward to the http://www.example.co.uk site.
relatedlinks vs. similar entries
I noticed that you added related links. I'm trying out both related links and similar entries modules (http://drupal.org/project/similar) on a site. I'm not sure which is better. Any ideas?
--
Knaddison Family | mmm Beta Burritos
knaddison blog | Morris Animal Foundation
Good question
I haven't yet tried out the similar entries module - thanks for pointing it out - when I first tried related links, I didn't care for it much because it was pretty random about the recommendations, but didn't spend a lot of time on it due to other reasons. I've upgraded to a recent release, and it's much better at making recommendations based on taxonomy and other factors. You can see it in use on one of my sites:
http://www.roadcarvin.com/bikes/cool-chopper (or view any front page node in full node view, the related links are at the bottom.)
With the related links module, a results depended on taxonomy terms, and if you had broad categories, the matches weren't all that relevant. The latest version seems to be much better and offer more administrator control.
Michael Curry
Exodus Development | Drupal and other developer info
Michael Curry
Drupal and Windows Tips
Feedback?
Any more information on the comparison between these two modules would be greatly appreciated. A list of pro's and con's would be great.
Edit: I've successfully used RelatedLinks and reckon it's pretty sound...
Web Development in Nottingham, UK by Kineta Systems / Follow me on Twitter! @NikLP
update
I'm using both on a site and can't decide which are better :/ I guess that means they are both good?
Also, the pivots module purports to do a similar thing but appears to require significantly more configuration/overhead.
--
Knaddisons Denver Life | mmm Chipotle Log | The Big Spanish Tour
knaddison blog | Morris Animal Foundation
I've used both of these now.
I've used both of these now. Related links is my preferred option, the configuration is more simple and there are more options.
Similar entries seems to work, but the config is fairly nasty, and I can't see that the results are massively relevant yet. Perhaps this will change when I add more content to the site.
Kineta Systems - Web Development in Nottingham, UK
Web Development in Nottingham, UK by Kineta Systems / Follow me on Twitter! @NikLP