Sometimes, it makes you crazy when you see that your Codeigniter (CI) application is not working in live server. This type CI problem is very usual in DramHost or BrainHost server due to .htaccess configuration. You will have to do a little changes to make the .htaccess work.
In your config.php file, please set
$config['index_page'] = "";
and
$config['uri_protocol'] = "AUTO";
Finally, add this .htaccess file to your server root or in the folder where your files are located…
<IfModule mod_rewrite.c> Options +MultiViews +FollowSymLinks DirectoryIndex index.php index.html RewriteEngine on RewriteRule modules/(.+)/controllers/(.+)\.php$ /index.php?/$1/$2 [L,R=301] RewriteRule controllers/(.+)\.php$ /index.php?/$1 [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule>
Yeah!! it’s done. And your CI app is working properly.
Vaia, Do you know any free host server which will allow me to change its default .htaccess? I was using zymic host for an online file uploader but I guess when the uploading time increases and exceeds a certain time, it prompts “No file uploaded\file type does not match!” and so on. I think i need to change .htaccess and reset the time limit. But free servers are not allowing me to do so, is there any other way to do that? Or any other free server will you suggest?
Basically you will upload the .htaccess file with your application. So, definitely you can change that.