SEO and Redirection

Discussion corner for Developers of Serendipity.
Post Reply
adamcharnock
Regular
Posts: 22
Joined: Sat Mar 08, 2008 1:02 am
Location: London, England
Contact:

SEO and Redirection

Post by adamcharnock »

Hey Folks,

I have been brushing up on (read: getting around to learning) my SEO skills for the past couple of days and I have become aware of the problem of duplicate content.

Here is some backgound: It seems that search engines tend not to like finding multiple pages with duplicate content. At best it can dilute the dilute the pages ranking in the search results, and at worst it can been seen as spamming the search engine. Needless to say, Google explains it much better:

http://www.google.com/support/webmaster ... swer=66359

My point is that with Serendipity (running mod_rewrite) it is possible to access the same page from a wide variety of URLs (as everything between the ID and the .html in the file name is ignored).

I have spent a little while tonight trying to come up with the basics of an SEO module (which can be merged with something else at a later date if needs be) which detects what URL has been used to access a page, and then what URL Serendipity would normally supply for that page. If they match then do nothing, otherwise 301 redirect the user to the normal URL.

The way I want to do this was:
1 - Get the URL being used _before_ the rewrite (my plan was to use $_SERVER['REQUEST_URI'])
2 - Get the ID from that URL (presumably using a pre-existing function designed for the task)
3 - Get Serendipity to generate me the expected/normal URL for the ID
4 - Do the matching and redirect if necessary

However, as I am not too experienced with Serendipity's workings I have had problems finding the functions for 2 and 3. Could someone give me some pointers on this?

Also, and other ideas are welcome, and please tell me if anything I have assumed here is wrong!

I was also thinking of including an option in the plugin to add rel='nofollow' to the 'homepage' links on comments (please don't take that personally judebert, I have nothing against your site!).


Thanks!

Adam

PS. Argh, just saw how long this post is, sorry! Maybe we should have word counts rather that post counts under our names :p
Adam Charnock
Did I help you? You could link to my
blog or leave a comment: http://porteightyeight.com
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: SEO and Redirection

Post by garvinhicking »

Hi!

The functions you need are mostly accessed through index.php, and are serendipity_searchPermalink() and serendipity_archiveURL(). Both functions are declared in include/functions_permalinks.inc.php.

You might want to consider though, if you want "REAL" urls to simply change the URL permalink pattern in your s9y configuration and remove the %id% from the URL. Then you will always have a forced URL lookup?
I was also thinking of including an option in the plugin to add rel='nofollow' to the 'homepage' links on comments (please don't take that personally judebert, I have nothing against your site!).
I'm personally a big fan of crediting commentor URLs, as they once were one of the biggest reasons blogs got good pagerank. "nofollow" IMHO is only good for spam, but then again: You don't want spam comments in your entries at all, so they shouldn't even appear in your blog ;)
PS. Argh, just saw how long this post is, sorry! Maybe we should have word counts rather that post counts under our names :p
Ah, I'm a verbose writer myself at times. I like text. :-)


Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Re: SEO and Redirection

Post by judebert »

adamcharnock wrote: I was also thinking of including an option in the plugin to add rel='nofollow' to the 'homepage' links on comments (please don't take that personally judebert, I have nothing against your site!).
Whaddidido :?:

Oh -- did I leave a comment with my homepage on your website? (You've changed your avatar, haven't you?!) I wouldn't get offended. "Yesfollow" links are nice as an incentive to contribute, but I would've left the comment either way.
Judebert
---
Website | Wishlist | PayPal
adamcharnock
Regular
Posts: 22
Joined: Sat Mar 08, 2008 1:02 am
Location: London, England
Contact:

Post by adamcharnock »

Well I thought I should probably have an avatar as all the cool kids seem to have them :p

From what I can gather, SEO seems to be a very sketchy and guesswork-based area, but a there are a couple of points regarding links:

1 - If search engines sees "too many" (whatever that is) external links on a page it may devalue the ones that the author wants to place emphasis on.
2 - If your page links to content which is appears unrelated it can apparently hurt your pages rank.

Then again, the major search engines should be getting pretty good at handling blogs by know (you would hope!) I am not saying using nofollow is right or wrong, but it is one of those things that probably applies to the blogger's situation and paranoia level.

Another thing I may do is check that the pagination module (that allows you to split an article into multiple pages) allows for linking directly to numbered pages, rather than only using previous/next links.

I certainly don't pretend to be an expert in SEO, but these are just a couple of things I may have a look at if I get the time.
Adam Charnock
Did I help you? You could link to my
blog or leave a comment: http://porteightyeight.com
Post Reply