<?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>Open Source Web &#187; fix</title>
	<atom:link href="http://www.open-source-web.com/tag/fix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.open-source-web.com</link>
	<description>Your open source for Development and Design</description>
	<lastBuildDate>Sun, 08 Jan 2012 10:21:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Fix Canonical URL with link rel=&#8221;canonical&#8221; in PHP</title>
		<link>http://www.open-source-web.com/seo/fix-canonical-url-with-link-relcanonical-in-php/</link>
		<comments>http://www.open-source-web.com/seo/fix-canonical-url-with-link-relcanonical-in-php/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 20:32:54 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[Canonical]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tag]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=83</guid>
		<description><![CDATA[Recently the major search engines have worked together to help fix one of the biggest problems in SEO, The canonical URL. With this quick fix all you need to do is add a tag to the &#60;head&#62; section of the page and search engines will use this as an anchor to index the page. since [...]]]></description>
			<content:encoded><![CDATA[<p>Recently the major search engines have worked together to help fix one of the biggest problems in SEO, The canonical URL. With this quick fix all you need to do is add a tag to the &lt;head&gt; section of the page and search engines will use this as an anchor to index the page.</p>
<p>since it is still fairly new we don&#8217;t know how it will work in the long run and if there are any side effects such as the pagerank not transferring.</p>
<p>The new tag looks like this</p>
<p align="center"><strong><code>&lt;link rel="canonical" href="http://www.open-source-web.com/"&gt;</code></strong></p>
<p>But nothing can be that easy, obviously with a large site you wouldn&#8217;t want to write that out for a million pages so here is the PHP code to make it work.</p>
<pre name="code" class="php">

$thispage = "http://www.";
$thispage .= $_SERVER["SERVER_NAME"];
$thispage .= $_SERVER["PHP_SELF"];
if($_SERVER["QUERY_STRING"]){$thispage .= "?".$_SERVER["QUERY_STRING"];}

&lt;link rel="canonical" href="&lt;? echo $thispage;?&gt;"&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/seo/fix-canonical-url-with-link-relcanonical-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

