My Blog is now "nofollow" compliant

After a suggestion by Scott Watermasysk, I've patched my .Text Blog engine to support the new rel="nofollow" tag.

To implement this feature, you've obviously to recompile the entire .Text source code, but the work you've to do is a few... As Scott suggests:

The class to change is Dottext.Framework.Util.Globals. Method: EnableUrls (found in Dottext.Framework\Util\Globals.cs)

In this method, .Text will look for links posted in a comment (prior to this call the entire comment is HtmlEncoded).

You've to go to this line of code:

text = text.Replace(m.ToString(), "<a target=\"_new\" href=\"" + m.ToString() + "\">" + m.ToString() + "</a>");

and change it with the modified url like this:

text = text.Replace(m.ToString(), "<a rel=\"nofollow\" target=\"_new\" href=\"" + m.ToString() + "\">" + m.ToString() + "</a>");

All new comments will now have urls with the rel="nofollow" attribute applied and this url's Google Page Rankings won't increase ...

The results of my actual antispam methods (CAPTCHA control and SQL Filter together) are wonderful... before them I was receiving from 5 to 10 spam comments a day, after that in a week I've received anything that could be targeted as spam. Great...

I hope that after this other antispam countermeasure spammers will forgot my Blog!

Print | posted on Friday, January 21, 2005 3:15 PM

Comments on this post

No comments posted yet.

Your comment:

 (will show your gravatar)
 
Please add 5 and 2 and type the answer here: