<?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>bitplane.net &#187; html</title>
	<atom:link href="http://bitplane.net/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://bitplane.net</link>
	<description>Rants, ramblings, free software</description>
	<lastBuildDate>Tue, 08 May 2012 13:57:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>This [e107] page has moved permanently [to gallery2]</title>
		<link>http://bitplane.net/2009/09/http-301/</link>
		<comments>http://bitplane.net/2009/09/http-301/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 09:47:43 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[bitplane.net]]></category>
		<category><![CDATA[e107]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=102</guid>
		<description><![CDATA[A quick tutorial on moving from e107 to WordPress while retaining your pagerank.]]></description>
			<content:encoded><![CDATA[<p>If you do a Google search for some of my really old code, like my <a href="http://www.google.com/search?q=py9+dictionary">Python T9 Dictionary</a> or <a href="http://www.google.com/search?q=XBMC+IRC+MP3+downloader">XBMC IRC MP3 downloader</a>, you&#8217;ll notice that my pagerank has been carried over to SVN and the <a href="http://gallery.bitplane.net/">gallery</a>. This is because Google and other search engines take note of HTTP 301 response codes and update their links accordingly.</p>
<p>When I migrated from e107 to WordPress and Gallery2, I replaced download.php with a redirect script which redirects to the gallery, svn or file dumps. The script looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// lots excluded</span>
<span style="color: #000088;">$table</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'4'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'http://svn.bitplane.net/misc/trunk/py/py9/readme.txt'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$address</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://bitplane.net/'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$index</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$i</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$table</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$index</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$address</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$table</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$index</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// send 301 (permanent redirect)</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;HTTP/1.1 301 Moved Permanently&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$address</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;
This file has permanently moved &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$address</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;here&lt;/a&gt;
&lt;/body&gt;&lt;/html&gt;</pre></div></div>

<p>So when you try to view <a href="http://bitplane.net/download.php?view.8">PY9</a>, you&#8217;re redirected to the new location. There&#8217;s no excuse for 404 errors when you move your site around, if you care about keeping the web up-to-date then please use a redirect script!</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2009/09/http-301/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

