Does it have to be a server side solution? jQuery would make this a snap:

$(document).ready(function(){
        $('a[href^="http"]').attr('rel','nofollow');
});

<a href="/somepage.html">This is an internal link</a>
<br><br>
<a href="http://google.com";>And this is an external link, with no follow</a>


-----Original Message-----
From: Jeff Becker [mailto:[email protected]] 
Sent: Wednesday, January 14, 2009 8:58 AM
To: cf-talk
Subject: nofollow regex

Hey folks,
Since I got no love in the RegEx forum, I'm hoping to post here to get a
little more eyeballs on the question I'm struggling over.

I'm looking for a working rel="nofollow" regex to modify links.

For example:

Goto <a href="http://google.com";>Google</a> now!
and turning it into:
Goto <a href="http://google.com"; rel="nofollow">Google</a> now!

The best solution I've found so far is:
http://www.sitecritic.net/articleDetail.php?id=242  , but this is a PHP
solution.  Any ideas on converting this to Coldfusion?

The PHP solution covers a lot of scenarios (extra attributes, single quotes
instead of double quotes) etc.. so that would be ideal.

Thanks! 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317923
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to