Welcome Guest, Not a member yet? Register   Sign In
GoDaddy headaches, CodeIgniter, and bears, oh my!

ci ver. 2.0
(if you're impatient...scoll down and I post of my solution)

I've spent the last 9 months getting to know codeigniter; it has worked like a dream on my local xampp environment. I plan on using for some production work for some clients soon...so I figured; let me quick place ci on my godaddy shared server and iron out any kinks. What a gosh-darn headache. None of the posts here, there or anywhere solved my problems (i think they are older and maybe involve previouse versions of ci)

Here's some of the rubbish I tried (+other stuff outside this forum):

I tried every imaginable combination of this junk combining .htaccess settings and config settings. None of it worked and what's worse; working off the server is near impossible to trouble shoot and the slowest process ever. I was at this for nearly 6 hours- then I took a different approach. I started hacking apart core files and placing simple echo statements to see what was loading and what was not.

***I figured out that the constants: APPPATH and BASEPATH that ci were declaring were simply relative paths: like 'system' and 'application' which work fine locally but not with godaddy.

MY SOLUTION:in root dir > index.php
i changed:
$system_path = 'system';//old
$system_path = '/home/content/a/b/c/abcperson/html/somedomain_dir/system';//new
$application_folder = 'application';//old
$application_folder = '/home/content/a/b/c/abcperson/html/somedomain_dir/application';//new
You will have to use the full path in your godaddy account.

for the application > config.php I didn't even change anything other than the domain for live testing
$config['base_url']    = 'http://mydomain.com/';
$config['index_page'] = 'index.php';
$config['uri_protocol']    = 'AUTO'; //left this despite all the fancy recommendations

MY QUESTIONS ~for you ci experts ? ?

Am I missing something?

Why are all the other solutions so damn complex? I don't even have an .htaccess file and I have working short urls as in: http://mysite.com/index/

One problem i did notice is that going to http://mysite.com throws ci's 404; that is one thing I will need to figure out(probably an .htaccess thing)
-Got any advice on that?

Hopefully this helps others and I would love to hear some insight from some experts here.

Well you can try a few things, GoDaddy is one of the worst sites for hosting CodeIgniter!
For one GoDaddy caches the .htacces etc for one hour so any changes could take an hour to reflect!
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|img|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

$config['index_page']   = "index.php?";
$config['uri_protocol'] = "QUERY_STRING";

// .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]


neither one worked...locally or live.

(i can remember pulling my hair out years ago with godaddy's caching on php.ini files when i was building a large file uploader and trying to set params; *I thought i read somewhere, recently that they stopped caching such things php.ini, .htaccess?)

btw: I never quite understood the "query_string" method. I could never get it to work even locally; not sure why. And to be honest I can't understand why anyone would want to use that method regardless... I thought one of the greatest parts of using CI was in its implementation of pretty, SEO, pages

Theme © iAndrew 2016 - Forum software by © MyBB