<?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>Hathology &#187; redirect</title>
	<atom:link href="http://hathology.com/tag/redirect/feed/" rel="self" type="application/rss+xml" />
	<link>http://hathology.com</link>
	<description></description>
	<lastBuildDate>Tue, 02 Mar 2010 13:58:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How To Setup A Permanent Redirect (HTTP 301) With PHP</title>
		<link>http://hathology.com/how-to-setup-a-permanent-redirect-http-301-with-php/</link>
		<comments>http://hathology.com/how-to-setup-a-permanent-redirect-http-301-with-php/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 13:26:08 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[How To's]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://hathology.com/?p=76</guid>
		<description><![CDATA[The HTTP 301 status code is meant for use when you want to redirect a page or URL to its new destination after reorganizing or moving a web site around. This can be on the same domain or an entirely new domain. Here is the W3C definition of the 301 code.
The requested resource has been [...]]]></description>
			<content:encoded><![CDATA[<p class="first-child "><span title="T" class="cap"><span>T</span></span>he HTTP 301 status code is meant for use when you want to redirect a page or URL to its new destination after reorganizing or moving a web site around. This can be on the same domain or an entirely new domain. Here is the W3C definition of the 301 code.</p>
<blockquote><p>The requested resource has been assigned a new permanent URI and any    future references to this resource SHOULD use one of the returned    URIs.  Clients with link editing capabilities ought to automatically    re-link references to the Request-URI to one or more of the new    references returned by the server, where possible. This response is    cacheable unless indicated otherwise.</p>
<p>The new permanent URI SHOULD be given by the Location field in the    response. Unless the request method was HEAD, the entity of the    response SHOULD contain a short hypertext note with a hyperlink to    the new URI(s).</p>
<p>If the 301 status code is received in response to a request other    than GET or HEAD, the user agent MUST NOT automatically redirect the    request unless it can be confirmed by the user, since this might    change the conditions under which the request was issued.<br />
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2" target="_blank">W3C Hypertext Transfer Protocol</a></p></blockquote>
<p>This is particularly useful for search engines like Google, which will carry over page rank to the new page if this status code is seen. If you do not need to indicate permanent displacement, you can accomplish redirection by setting a Location header in PHP. The <em>location</em> header does the actual redirection to the new location, and can be used by itself.</p>
<p>If you set the Location header by itself, PHP automatically sets the status code to <em>HTTP/1.1 302 Found</em>.</p>
<p>Note, if you attempt to send headers after content has been sent, you will get a warning like, <em>&#8220;Warning: Cannot modify header information &#8211; headers already sent by &#8230;&#8221;</em>.  Watch out for empty lines and spaces between PHP open and close tags.</p>
<p>Here is the code to do this in PHP&#8230;</p>
<p><code>&lt;?php<br />
// Permanent redirection<br />
header("HTTP/1.1 301 Moved Permanently");<br />
header("Location: http://www.example.com/");<br />
exit();<br />
?&gt;</code></p>
<p>Just make sure you put these lines in your page before any other content is sent out. The http://www.example.com/ part can be changed to whatever the new address for this resource is.</p>
]]></content:encoded>
			<wfw:commentRss>http://hathology.com/how-to-setup-a-permanent-redirect-http-301-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
