<?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>Lacisoft&#039;s &#187; permanent redirect</title>
	<atom:link href="http://www.lacisoft.com/blog/tag/permanent-redirect/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lacisoft.com/blog</link>
	<description>SELECT * FROM lacisoft</description>
	<lastBuildDate>Mon, 30 Jan 2012 17:42:20 +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>How to make a permanent (301) redirect with PHP</title>
		<link>http://www.lacisoft.com/blog/2009/04/28/how-to-make-a-permanent-301-redirect-with-php/</link>
		<comments>http://www.lacisoft.com/blog/2009/04/28/how-to-make-a-permanent-301-redirect-with-php/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 07:18:14 +0000</pubDate>
		<dc:creator>lacisoft</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[301 redirect]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[permanent redirect]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.lacisoft.com/blog/?p=211</guid>
		<description><![CDATA[Often we need to redirect permanently a page to a new location and this can be accomplished in many ways. I will discuss today the PHP method because this is the one i most often run into. So you can make a header redirect with php in the following manner: &#60;?php header("Location: /example.php"); ?&#62; But [...]
Related posts:<ol>
<li><a href='http://www.lacisoft.com/blog/2009/04/10/how-to-make-a-drag-and-drop-sorted-list-with-jquery-sortable/' rel='bookmark' title='How to make a drag and drop sorted list with jQuery Sortable'>How to make a drag and drop sorted list with jQuery Sortable</a></li>
<li><a href='http://www.lacisoft.com/blog/2008/11/21/how-to-make-a-brand-hated-with-newsletters/' rel='bookmark' title='How to make a brand hated, with newsletters'>How to make a brand hated, with newsletters</a></li>
<li><a href='http://www.lacisoft.com/blog/2009/04/15/how-some-people-make-free-software-more-to-cost-more-then-commercial-software/' rel='bookmark' title='How some people make free software to cost more then commercial software'>How some people make free software to cost more then commercial software</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Often we need to redirect permanently a page to a new location and this can be accomplished in many ways. I will discuss today the PHP method because this is the one i most often run into.</p>
<p>So you can make a header redirect with php in the following manner:</p>
<p><span class="html"><span class="keyword"><strong>&lt;?</strong></span></span><strong><code><span class="html"><span class="default">php</span></span></code></strong></p>
<p><strong><code><span class="html"><span class="default">header</span><span class="keyword">(</span><span class="string">"Location: /example.php"</span><span class="keyword">);</span></span></code></strong></p>
<p><strong><span class="html"><span class="keyword">?&gt;<br />
</span></span></strong></p>
<p><span class="html"><span class="keyword">But keep in mind that this is a temporary redirect. If you need to make it a permanent (301) redirect then you need to add some additional code. </span></span></p>
<p>One method is to add an additional response code to the header redirect:</p>
<p><span class="html"><span class="keyword"><strong>&lt;?</strong></span></span><strong><code><span class="html"><span class="default">php</span></span></code></strong></p>
<p><strong><code><span class="html"><span class="default">header</span><span class="keyword">(</span><span class="string">"Location: /example.php"</span><span class="keyword">,</span><span class="default">TRUE</span><span class="keyword">,</span><span class="default">301</span><span class="keyword">);</span></span></code></strong></p>
<p><strong><span class="html"><span class="keyword">?&gt;<br />
</span></span></strong></p>
<p><span class="html"><span class="keyword">The other method is a bit longer:</span></span></p>
<p><span class="html"><span class="keyword"><strong>&lt;?php</strong></span></span></p>
<p><strong>header(&#8216;HTTP/1.1 301 Moved Permanently&#8217;);<br />
header(&#8216;Location: http://www.example.com&#8217;);</strong></p>
<p><strong>?&gt; </strong></p>
<p><span class="html"><span class="keyword">Both these methods do the same thing so its up to you which one to use. </span></span></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.lacisoft.com%2Fblog%2F2009%2F04%2F28%2Fhow-to-make-a-permanent-301-redirect-with-php%2F&amp;title=How%20to%20make%20a%20permanent%20%28301%29%20redirect%20with%20PHP" id="wpa2a_2"><img src="http://www.lacisoft.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://www.lacisoft.com/blog/2009/04/10/how-to-make-a-drag-and-drop-sorted-list-with-jquery-sortable/' rel='bookmark' title='How to make a drag and drop sorted list with jQuery Sortable'>How to make a drag and drop sorted list with jQuery Sortable</a></li>
<li><a href='http://www.lacisoft.com/blog/2008/11/21/how-to-make-a-brand-hated-with-newsletters/' rel='bookmark' title='How to make a brand hated, with newsletters'>How to make a brand hated, with newsletters</a></li>
<li><a href='http://www.lacisoft.com/blog/2009/04/15/how-some-people-make-free-software-more-to-cost-more-then-commercial-software/' rel='bookmark' title='How some people make free software to cost more then commercial software'>How some people make free software to cost more then commercial software</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.lacisoft.com/blog/2009/04/28/how-to-make-a-permanent-301-redirect-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

