<?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>blacknode &#187; SEO</title>
	<atom:link href="http://blog.blacknode.net/category/sysadmin/seo/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.blacknode.net</link>
	<description>NO CARRIER</description>
	<lastBuildDate>Mon, 13 Jun 2011 07:12:29 +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>Redirect index.php to root of current directory</title>
		<link>http://blog.blacknode.net/2009/05/redirect-indexphp-to-root-of-current-directory/</link>
		<comments>http://blog.blacknode.net/2009/05/redirect-indexphp-to-root-of-current-directory/#comments</comments>
		<pubDate>Fri, 01 May 2009 18:11:20 +0000</pubDate>
		<dc:creator>jrod</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[webmaster]]></category>

		<guid isPermaLink="false">http://blog.blacknode.net/?p=162</guid>
		<description><![CDATA[An SEO conscious customer was having duplicate content issues for: http://domain.com/something/ and http://domain.com/something/index.php Simply rewriting index.php to / will not be effective as httpd makes an internal redirect to the DirectoryIndex, causing a redirect loop. In order to distinguish between the internal redirect and a client request, the %{THE_REQUEST} server variable is used. When placed ]]></description>
			<content:encoded><![CDATA[<p>An SEO conscious customer was having duplicate content issues for:</p>
<blockquote>
<p>http://domain.com/something/</p>
<p>and</p>
<p>http://domain.com/something/index.php</p>
</blockquote>
<p>Simply rewriting index.php to / will not be effective as httpd makes an internal redirect to the DirectoryIndex, causing a redirect loop.</p>
<p>In order to distinguish between the internal redirect and a client request, the %{THE_REQUEST} server variable is used.</p>
<p>When placed in the in the Directory context in the httpd.conf  or in the .htaccess file located in the document root or desired origin directory, the following rule will achieve the desired results:</p>
<blockquote><p>
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{THE_REQUEST} ^[A-Z]+\ (.*)/index.php\ HTTP/<br />
RewriteRule .*index.php$ http://%{HTTP_HOST}%1/ [L]
</p></blockquote>
<p>Note, this should be placed before any query_string rewriting you are doing for things like clean urls.</p>
<p>This will work recursively from its origin, so:</p>
<blockquote>
<p>http://domain.com/something/index.php</p>
<p>and</p>
<p>http://domain.com/something/else/index.php</p>
</blockquote>
<p>will be rewritten to:</p>
<blockquote>
<p>http://domain.com/something/</p>
<p>and</p>
<p>http://domain.com/something/else/</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.blacknode.net/2009/05/redirect-indexphp-to-root-of-current-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

