2

When I run Codeigniter 3.0 application at local server, it works fine. However, when I uploaded it to Bluehost, it doesn't work.

Codeigniter itself is working but I get a Codeingiter 404 and not an Apache 404 - the page gets style, etc etc.

I think the problem has to do with Codeigniter 3.0 and Bluehost, since I uploaded 2 different apps to BH.

When I use Codeigniter 2.x, everything works fine.

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
Muni Perez
  • 70
  • 9
  • * I will post my .htaccess soon, I'm on mobile now. But if anyone already knows of this issue and how to solve it. Thank you – Muni Perez Aug 05 '15 at 17:48

2 Answers2

3

Starting with CodeIgniter 3.0, all class filenames (libraries, drivers, controllers and models) must be named in a Ucfirst-like manner or in other words - they must start with a capital letter.

Controllers:

application/controllers/welcome.php to application/controllers/Welcome.php

Models:

application/models/misc_model.php to application/models/Misc_model.php

Source: Classes file naming Conversion in CodeIgniter

Note that this DOES NOT affect directories, configuration files, views, helpers, hooks and anything else - it is only applied to classes.

You must now follow just one simple rule - class names in Ucfirst and everything else in lowercase.

and .htaccess should be

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule>
Community
  • 1
  • 1
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
  • Thanks Abdulla! I changed the case on the classes files and it worked perfectly. However, how do you explain it working on my computer and having this problem only after I upload it to Bluehost? (I didn't test it in any other hosting provider). Best regards! – Muni Perez Aug 06 '15 at 13:16
  • Sorry I forgot ;) Done. – Muni Perez Aug 06 '15 at 13:39
0

I hope the following .htaccess will work for you:

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
Ariful Islam
  • 7,639
  • 7
  • 36
  • 54
  • 1
    Arif, thanks for your answer.. It still doesn't work. I'm going to test what ABdulla said bellow. Best regards – Muni Perez Aug 06 '15 at 13:10