<?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>Richard Shepherd &#187; Live HTTP Headers</title>
	<atom:link href="http://www.richardshepherd.com/tag/live-http-headers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.richardshepherd.com</link>
	<description>Making the web. Better looking.</description>
	<lastBuildDate>Fri, 04 Jun 2010 18:03:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>.htaccess and 302 redirect problems fixed</title>
		<link>http://www.richardshepherd.com/htaccess-and-302-redirect-problems-fixed/</link>
		<comments>http://www.richardshepherd.com/htaccess-and-302-redirect-problems-fixed/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 23:41:55 +0000</pubDate>
		<dc:creator>richardshepherd</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[301]]></category>
		<category><![CDATA[301 redirect]]></category>
		<category><![CDATA[302]]></category>
		<category><![CDATA[302 redirect]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Live HTTP Headers]]></category>

		<guid isPermaLink="false">http://www.growlingranger.com/?p=455</guid>
		<description><![CDATA[So I had quite a specific problem. For some reason, http://growlingranger.com was redirecting to http://www.growlingranger.com with a 302 redirect. And, as SEO guru (and friend) Ken Jones from the SEOpsCentre put it, that&#8217;s bad SEO juju. 302 means that the address has moved temporarily, and will be back soon. Which in turn meant that my [...]]]></description>
			<content:encoded><![CDATA[<p>So I had quite a specific problem. For some reason, http://growlingranger.com was redirecting to http://www.growlingranger.com with a <a href="http://en.wikipedia.org/wiki/HTTP_302" target="_blank">302 redirect</a>. And, as SEO guru (and friend) Ken Jones from the <a href="http://www.seopscentre.com/" target="_blank">SEOpsCentre</a> put it, that&#8217;s bad SEO juju.</p>
<p>302 means that the address has moved temporarily, and will be back soon. Which in turn meant that my entire site (everything at www.growlingranger.com) was seen by Google and others as temporary. Bad juju indeed.</p>
<p>How do you know this? Well, I downloaded and installed a Firefox plugin called <a href="https://addons.mozilla.org/en-US/firefox/addon/3829" target="_blank">Live HTTP Headers</a>, which does exactly what it says on the packet. It gives you a feed of the HTTP headers as you load a page. And my headers had an ominous 302 redirect.</p>
<p>What I <em>need</em> is for it to be a <a href="http://en.wikipedia.org/wiki/HTTP_301" target="_blank">301 redirect</a>, which means the address has moved permanently and that any <a href="http://www.seopscentre.com/seo/how-to-explain-link-theory-to-a-layman/" target="_blank">lovely link juice</a> is passed on.</p>
<p>Now I tried everything to fix this, including my DNS entries. Scary stuff indeed. But nothing seemed to work. My hosting is with GoDaddy, so if you&#8217;ve also had this problem and you know why it happens then please let me know!</p>
<p>However, we were able to find a fix thanks to Ken Jones and his .htaccess awesomeness.</p>
<p>My .htaccess file already has some WordPress stuff in there, which looks like this:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># BEGIN WordPress<br />
<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
<br />
# END WordPress</div></td></tr></tbody></table></div>
<p>And that&#8217;s just doing funky things with my permalinks &#8211; how my blog has friendly URLs like http://www.growlingranger.com/2009/02/how-to-use-jquery-with-a-json-flickr-feed-to-display-photos/ instead of http://www.growlingranger.com/?p=455.</p>
<p>What we need to add was a bit of redirect code that takes anything and everything from http://growlingranger.com/ and forwards it <em><strong>permanently </strong></em>to http://www.growlingranger.com/.</p>
<p>And here it is:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>HTTP_HOST<span style="color: #009900;">&#125;</span> ^growlingranger<span style="color: #339933;">.</span>com <span style="color: #009900;">&#91;</span>NC<span style="color: #009900;">&#93;</span><br />
RewriteRule ^<span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span>$ http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.growlingranger.com/$1 [L,R=301]</span></div></td></tr></tbody></table></div>
<p>If you&#8217;ve experienced the same problem you can just replace &#8216;growlingranger&#8217; with whatever your domain is. If you&#8217;re successful you&#8217;ll get something like this in Live HTTP Headers&#8230;</p>
<p><a href="http://www.richardshepherd.com/wpblog/wp-content/uploads/2009/02/livehttpheaders1.jpg" target="_blank"><img class="alignnone size-medium wp-image-459" title="Live HTTP Headers" src="http://www.richardshepherd.com/wpblog/wp-content/uploads/2009/02/livehttpheaders-300x198.jpg" alt="Live HTTP Headers" /></a></p>
<p>Now I have restored my SEO juju, and it shouldn&#8217;t be long before Google catches up.</p>
<p>Ranger, out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardshepherd.com/htaccess-and-302-redirect-problems-fixed/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
