Welcome Guest, Not a member yet? Register   Sign In
Cannot instantiate non-existent class:
#8

[eluser]Heatherita[/eluser]
Hi!

OK, I'd been getting 404's all morning, after ucfirst-ing the name of the model, removing "public" and "private" before model methods, etc.

In fact, it was looking like I couldn't access any url other than the "default controller" that I'd specified in config.php.

Finally, I found the solution in my .htaccess file:

("before" version)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [QSA,L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>

I had to remove the "RewriteBase" line, and add "?" in the RewriteRule lines, so now it looks like this:

("after" version)

<IfModule mod_rewrite.c>
RewriteEngine On

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [QSA,L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>


Now it works great. I can access my controllers using the standard convention hostname/controller/method/

So happy! Thanks so much to everyone! Can't wait to really get going with CodeIgniter! I used Java Struts a few years ago and really liked it....

Heather


Messages In This Thread
Cannot instantiate non-existent class: - by El Forum - 05-29-2008, 03:34 PM
Cannot instantiate non-existent class: - by El Forum - 05-29-2008, 03:48 PM
Cannot instantiate non-existent class: - by El Forum - 05-29-2008, 07:51 PM
Cannot instantiate non-existent class: - by El Forum - 05-30-2008, 07:09 AM
Cannot instantiate non-existent class: - by El Forum - 05-30-2008, 07:22 AM
Cannot instantiate non-existent class: - by El Forum - 05-30-2008, 07:43 AM
Cannot instantiate non-existent class: - by El Forum - 05-30-2008, 07:44 AM
Cannot instantiate non-existent class: - by El Forum - 05-30-2008, 11:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB