SEO and Redirection
Posted: Thu Mar 13, 2008 12:26 am
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
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