Forum OpenACS Q&A: Re: The rel attribute (Rel="nofollow")

Collapse
Posted by Michael Bluett on
I thought I might mention some code I finally wrote to stop user links being counted towards PageRank. It's matter of knowing where to add it (I put it on the display side on my OpenACS 4.6 installation).

I added this code:
regsub {href=("|')h[^"']+("|')} $message(content) {& rel="nofollow"} content set message(content) $content
to this file:
packages/forums/www/message-chunk.tcl

And similar code to:
packages/general-comments/tcl/general-comments-procs.tcl
and
packages/general-comments/tcl/view-comment.tcl

Collapse
Posted by Michael Bluett on
As always, there's a more complete method that springs to mind one minute after posting (and the code above was mangled):

regsub -nocase -all {href="?'?h[^"' >]+"?'?} $message(content) {& rel="nofollow"} content

set message(content) $content