• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running CodeIgniter from Subfolder on Godaddy

Looks like CI's 404

your htaccess :
RewriteEngine On
RewriteBase /ci/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) /ci/index.php?/$1 [L]
And, clear the browser cache before you tested it.

Similar thread that maybe help or give you some idea : http://ellislab.com/forums/viewthread/186686/

I found the problem... but not sure as to the solution. I may start a new topic, if one doesn't already exist, but I'll try and give a brief explanation of what's going on.

The problem is with the routing.

I have a few controllers in the application/controllers directory: Index, About, Contact...
They each have an index() and an ajax() function. My default_controller route was set to 'Index' and I added another route for the ajax method like so: $route['rest/(:any)'] = "$1/ajax";

I did also add a contextPath config item for serving the app from a sub-directory. If the path was set I added a couple other routes:
$route[$contextPath] = 'Index';
$route["$contextPath/rest/(:any)"] = "$1/ajax";
$route["$contextPath/(:any)"] = "$1";

This works beautifully locally. Not so nice on GoDaddy.

With the app being served from a sub-directory on GoDaddy, the Index controller cannot be found without adding it to the url. So, www.mydom.com/ci gives a 404 and so does www.mydom.ci/index, while www.mydom.ci/Index loads the Index controller just fine. Also, www.mydom.com/ci/About was found, but www.mydom.com/ci/about gave a 404. Same thing for the contact page, it had to be Contact to find the controller not contact.

WTF GoDaddy?!?!

I guess I'll continue with this post...

So I changed the names of my controllers from camel cased to all lowercase and I also changed the default_controller route from Index to index and voila!! It now works like I was expecting it to work.

The extra routes with the contextPath aren't even necessary. I'm assuming the htaccess RewriteBase directive takes care of that.

I'm still in awe of this problem and the solution. Why on my Mac (Linux based OS and what I thought was case sensitive) does it not care about the letter casing of my controller names and GoDaddy's Linux boxes do?

Anyway... thanks for all your responses.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.