<?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>Web development blog &#187; duplicate content</title>
	<atom:link href="http://simplemediacode.info/tag/duplicate-content/feed/" rel="self" type="application/rss+xml" />
	<link>http://simplemediacode.info</link>
	<description>by Simple Media Code</description>
	<lastBuildDate>Wed, 09 May 2012 12:19:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Removing WWW from URI (or domain) with PHP</title>
		<link>http://simplemediacode.info/removing-www-from-uri-or-domain-with-php/</link>
		<comments>http://simplemediacode.info/removing-www-from-uri-or-domain-with-php/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 13:40:13 +0000</pubDate>
		<dc:creator>umbrovskis</dc:creator>
				<category><![CDATA[Coding web page]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[duplicate content]]></category>
		<category><![CDATA[non-www site]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[www prefix]]></category>

		<guid isPermaLink="false">http://simplemediacode.info/?p=136</guid>
		<description><![CDATA[Few weeks ago I wrote how to remove WWW from domain with .htaccess. In some cases or hosting plans it's not possible to view or use .htaccess file (e.g. some low cost or free hosting providers). Solution is PHP code which redirects all www requests to non www page....]]></description>
			<content:encoded><![CDATA[<p>Few weeks ago I wrote <strong><a title="how to remove WWW from domain with .htaccess" href="http://mediabox.lv/en/remove-www-from-domain-with-htaccess/">how to remove WWW from domain with .htaccess</a></strong>. In some cases or hosting plans it&#8217;s not possible to view or use .htaccess file (e.g. some low cost or free hosting providers).</p>
<p><strong>Solution is PHP code</strong> which redirects all www requests to non www page. Since You are (should) use some general configuration or header file in Your web application, you can include this PHP code (very top of php page):</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php // Removing WWW from URI with PHP http://simplemediacode.info/?p=136
if ('mediabox.lv' !== $_SERVER['HTTP_HOST']) {
header('Location: http://mediabox.lv' . $_SERVER['REQUEST_URI'], null, 301);
}
?&gt;
</pre>
<p>It use build-in <a href="http://php.net/manual/en/function.header.php">PHP header() function</a> to redirect all requests to another page, in this case: non-www domain.</p>
<p>Simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://simplemediacode.info/removing-www-from-uri-or-domain-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove WWW from domain with .htaccess</title>
		<link>http://simplemediacode.info/remove-www-from-domain-with-htaccess/</link>
		<comments>http://simplemediacode.info/remove-www-from-domain-with-htaccess/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 15:47:26 +0000</pubDate>
		<dc:creator>umbrovskis</dc:creator>
				<category><![CDATA[Coding web page]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[duplicate content]]></category>
		<category><![CDATA[non-www site]]></category>
		<category><![CDATA[www prefix]]></category>

		<guid isPermaLink="false">http://simplemediacode.info/?p=103</guid>
		<description><![CDATA[Another good thing about removing double content is to remove or add www prefix to your domain. Remove WWW from domain This is what I now use for all my domains &#8211; domain without www prefix. Add WWW to domain ...]]></description>
			<content:encoded><![CDATA[<p>Another good thing about removing double content is to remove or add <strong>www </strong>prefix to your domain.</p>
<h2>Remove WWW from domain</h2>
<pre class="brush: bash; title: ; notranslate">
# This will remove www from your domain
RewriteCond %{HTTP_HOST} ^www.mediabox.lv$ [NC]
RewriteRule ^(.*)$ http://mediabox.lv/$1 [R=301,L]
</pre>
<p>This is what I now use for all my domains &#8211; <strong>domain without www prefix</strong>.</p>
<h2>Add WWW to domain</h2>
<p>This probably is best for old domains like mine www.rolandinsh.lv</p>
<pre class="brush: bash; title: ; notranslate">
# This will remove www from your domain
RewriteCond %{HTTP_HOST} ^mediabox.lv$ [NC]
RewriteRule ^(.*)$ http://www.mediabox.lv/$1 [R=301,L]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://simplemediacode.info/remove-www-from-domain-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to remove index.html and/or index.php from the URL</title>
		<link>http://simplemediacode.info/remove-index-html-andor-index-php-from-the-url/</link>
		<comments>http://simplemediacode.info/remove-index-html-andor-index-php-from-the-url/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 17:56:40 +0000</pubDate>
		<dc:creator>umbrovskis</dc:creator>
				<category><![CDATA[Coding web page]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[duplicate content]]></category>
		<category><![CDATA[RegEx]]></category>
		<category><![CDATA[RegExp]]></category>
		<category><![CDATA[regular expressions]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress MU]]></category>
		<category><![CDATA[WPMU]]></category>

		<guid isPermaLink="false">http://simplemediacode.info/?p=8</guid>
		<description><![CDATA[Inspired by my discussion with Kaspars on his homepage konstruktors.com  how to better remove index file. So I'll post both versions, because they use different methods: with and with out RewriteEngine On....]]></description>
			<content:encoded><![CDATA[<p>Inspired by my discussion with Kaspars on his homepage <a title="Konstruktors" href="http://konstruktors.com/blog/web-design/2036-remove-index-html-from-the-url/">konstruktors.com</a> how to better <strong>remove index file</strong>. So I&#8217;ll post both versions, because they use different methods: <span style="text-decoration: underline">with</span> and <span style="text-decoration: underline">with out</span> <strong>RewriteEngine On</strong>.</p>
<p>Here is mine with <strong>RewriteEngine On</strong> (works on this hosting and both versions of GoDaddy hosting plans <em>example1.com</em> and <em>example1.com</em>/<em>example2.com</em>):</p>
<pre class="brush: bash; title: ; notranslate">
# This will remove index.html AND index.php from URL
RewriteCond %{THE_REQUEST} /index.(php|html) HTTP [NC]
RewriteRule (.*)index.(php|html)$ /$1 [R=301,L]
</pre>
<p>And Kaspar&#8217;s method without <strong>RewriteEngine On</strong>:</p>
<pre class="brush: bash; title: ; notranslate">
RewriteEngine On # remove this, if you have it already
RewriteCond %{REQUEST_URI} index.html
RewriteRule ^(.*)index.html$ /$1/ [R=301,L]
</pre>
<p>Purpose of this is to remove <strong>duplicate content</strong> from Internet.</p>
<p>[<strong>Update</strong> on 2010.03.30]</p>
<p>Please keep in mind that some <strong>web applications</strong> still need <strong>index.php</strong> file for <span style="text-decoration: underline">installation scripts</span> as referrers. So it&#8217;s good to keep it in mind and comment these line during installation process if it fails.</p>
<pre class="brush: bash; title: ; notranslate">
# This will remove index.html AND index.php from URL
# RewriteCond %{THE_REQUEST} /index.(php|html) HTTP [NC]
# RewriteRule (.*)index.(php|html)$ /$1 [R=301,L]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://simplemediacode.info/remove-index-html-andor-index-php-from-the-url/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

