How To Get CodeIgniter 2.x Working With Godaddy Hosting

After working on a site, made with codeigniter 2.0, for a couple of weeks in my local server I found out that the framework’s redirection of the index page did not work with the same code I used for older versions of the framework.

After one full day of googling none of the code I found seemed to work, the site I was working on was just an app I was doing for fun so I didn’t bother to continue looking. A couple of weeks ago however a friend of mine was working on a site and was also using codeigniter, but unlike me he found the fix to the redirection problem.

Here’s the code he used, let me know in the comments below if this worked for you.

#contents of .htaccess:
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond $1 !^(index\.php|captcha|images|robots\.txt|css|javascripts|audio)
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>