<?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>iamdave &#187; Godaddy</title>
	<atom:link href="http://i.amdave.com/archives/tag/godaddy/feed" rel="self" type="application/rss+xml" />
	<link>http://i.amdave.com</link>
	<description>Programmer - Baltimore, MD</description>
	<lastBuildDate>Mon, 10 May 2010 14:06:41 +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>Kohana v3 :: Godaddy &amp; Megahosters</title>
		<link>http://i.amdave.com/archives/26</link>
		<comments>http://i.amdave.com/archives/26#comments</comments>
		<pubDate>Wed, 14 Oct 2009 04:00:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Kohana]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Godaddy]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://i.amdave.com/?p=26</guid>
		<description><![CDATA[I have the opportunity (or problem, depending on my mood) to work with a diverse group of clients and many of the small business owners have hosting accounts with Godaddy, and one with Megahosters. Unlike most developers, I actually don&#8217;t mind godaddy so much, but, thats another post. The point of this post is that [...]]]></description>
			<content:encoded><![CDATA[<p>I have the opportunity (or problem, depending on my mood) to work with a diverse group of clients and many of the small business owners have hosting accounts with Godaddy, and one with Megahosters.  Unlike most developers, I actually don&#8217;t mind godaddy so much, but, thats another post.<br />
The point of this post is that I had to figure out how to get Kohana v3 working on Godaddy and Megahosters, so I thought I would pass the solution along</p>
<ol>
<li>Note:  I am installing Kohana at the root of the domain in booth cases</li>
<li>/.htaccess files
<ul>
<li>Godaddy
<div style="background-color:#eeeeee"><code><br />
# Turn on URL rewriting<br />
RewriteEngine On<br />
# Installation directory<br />
RewriteBase /<br />
# Protect application and system files from being viewed<br />
RewriteRule ^(application|modules|system) - [F,L]<br />
# Allow any files or directories that exist to be displayed directly<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
# Rewrite all other URLs to index.php/URL<br />
RewriteRule ^(.+)$ index.php?kohana_uri=$1 [L]</code></div>
</li>
<li>Megahosters
<div style="background-color:#eeeeee"><code><br />
AddHandler application/x-httpd-php5 .php<br />
# Turn on URL rewriting<br />
RewriteEngine On<br />
# Installation directory<br />
RewriteBase /<br />
# Protect application and system files from being viewed<br />
RewriteRule ^(application|modules|system)/ - [F,L]<br />
# Allow any files or directories that exist to be displayed directly<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
# Rewrite all other URLs to index.php/URL<br />
RewriteRule ^(.+)$ index.php?kohana_uri=$1 [L]</code></div>
</li>
</ul>
</li>
<li>/application/boostrap.php
<div>At the bottom of the bootstrap file, after the routing, is the execution statement.  By default it looks like this:</p>
<div style="background-color:#eeeeee;"><code><br />
echo Request::instance()<br />
-&gt;execute()<br />
-&gt;send_headers()<br />
-&gt;response;<br />
</code></div>
<p>Basically, you can pass an array when you instantiate the Request, but if you don&#8217;t (defualt), Kohana will use some <em>If / Else</em> statements to see which node of the $_SERVER array contains the request information.  This works fine on most servers, but on shared servers like Godaddy/Megahosters, the first $_SERVER node (PATH_INFO) checked sends bad information, so to fix it, you just need to pass the Request the correct node.  For both Godaddy and Megahosters, its the same:  REQUEST_URI.  So here is how it should look:</p>
<div style="background-color:#eeeeee;"><code><br />
echo Request::instance($_SERVER['REQUEST_URI'])<br />
-&gt;execute()<br />
-&gt;send_headers()<br />
-&gt;response;<br />
</code></div>
</div>
</li>
</ol>
<p>HOPE THIS HELPS!</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 582px; width: 1px; height: 1px;">AddHandler application/x-httpd-php5 .php</p>
<p># Turn on URL rewriting<br />
RewriteEngine On</p>
<p># Installation directory<br />
RewriteBase /</p>
<p># Protect application and system files from being viewed<br />
RewriteRule ^(application|modules|system)/ &#8211; [F,L]</p>
<p># Allow any files or directories that exist to be displayed directly<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d</p>
<p># Rewrite all other URLs to index.php/URL<br />
RewriteRule ^(.+)$ index.php?kohana_uri=$1 [L]</p></div>
]]></content:encoded>
			<wfw:commentRss>http://i.amdave.com/archives/26/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
