<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NGCoders - Next Generation Coders &#187; seo</title>
	<atom:link href="http://www.ngcoders.com/tag/seo/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ngcoders.com</link>
	<description>Personal Blog of Vikas Patial.</description>
	<lastBuildDate>Sun, 25 Jul 2010 08:01:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding nofollow to all outbound links to increase pagerank</title>
		<link>http://www.ngcoders.com/php/adding-nofollow-to-all-outbound-links-to-increase-pagerank</link>
		<comments>http://www.ngcoders.com/php/adding-nofollow-to-all-outbound-links-to-increase-pagerank#comments</comments>
		<pubDate>Sun, 24 Aug 2008 17:32:29 +0000</pubDate>
		<dc:creator>Vikas Patial</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[backlinks]]></category>
		<category><![CDATA[nofollow]]></category>
		<category><![CDATA[pagerank]]></category>
		<category><![CDATA[regexp url matching]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.ngcoders.com/?p=30</guid>
		<description><![CDATA[I have some sites which have been running for a long while, and due to not having time on my part to upgrade them they still run pretty old scripts with custom coding ( If it aint broke dont fix it   ). Some time back i realized the rel=&#8221;nofollow&#8221; thing and how people [...]]]></description>
			<content:encoded><![CDATA[<p>I have some sites which have been running for a long while, and due to not having time on my part to upgrade them they still run pretty old scripts with custom coding ( If it aint broke dont fix it <img src='http://www.ngcoders.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). Some time back i realized the rel=&#8221;nofollow&#8221; thing and how people posting links on those sites got Backlinks for free. After doing a little backlink checking i found that my sites were linking to competitor sites , which is totaly unacceptable.Also with so maybe free backlinks going out PR can be affected ( am not shore about that though ). So with a few lines of PHP you can kill all free back links people have been getting through ur side.</p>
<p>So if you are stuck with the same situation here is a little help , Assuming your site is running in php. What we do is buffer all the content and find all non site links and replace them with a additional nofollow tag.</p>
<div class="code">ob_start();</p>
<p>// Your sites code goes here</p>
<p>$content = ob_get_contents();<br />
@ob_end_clean();</p>
<p>preg_match_all(&#8216;!href[\s]*=[\s]*["\']{1}([\w]+?://[\w#$%&amp;~/.\-;:=,?@\[\]+]*)["\']{1}!&#8217;,$content,$matches);</p>
<p>// Replace all outbound links with nofollow</p>
<p>$replaced = array();</p>
<p>for($i=0;$i&lt;count($matches[0]);$i++)<br />
{<br />
if(strstr($matches[1][$i],&#8217;http://www.sitename.com&#8217;)) continue;<br />
if(strstr($matches[1][$i],&#8217;http://sitename.com&#8217;)) continue;</p>
<p>if(in_array($matches[0][$i],$replaced))continue;</p>
<p>$content = str_replace($matches[0][$i],$matches[0][$i].&#8217; rel=&#8221;nofollow&#8221;&#8216;,$content);</p>
<p>$replaced[] = $matches[0][$i];<br />
}</p>
<p>echo $content;</p></div>
<p>Now i hope this code increases the PR for the sites , they are PR 5 for now &#8230; will post results if i see any changes in the site stats.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ngcoders.com/php/adding-nofollow-to-all-outbound-links-to-increase-pagerank/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
