CodeIgniter Forums
function error - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: function error (/thread-13592.html)

function error - El Forum - 11-28-2008

I am just start with codeigniter 1 day ago
and i create a blog page like the user guide told me

class Blog extends Controller {

function index()
echo 'Hello World!';

function com()
echo 'Hello World2222222222222!';

and put the right code on the config file

but only the function index is loading
when i am trying to load the com function its show me the index
i am us this url:

anyone can help me?


function error - El Forum - 11-28-2008

[eluser]Pascal Kriete[/eluser]
You're missing index.php in your url.

CodeIgniter uses what is known as a front-controller. That means that all requests go through index.php and CodeIgniter figures out what controller to call. So the url you want is:

It is possible to remove index.php by using a little server trick to rewrite the urls. I won't go into it here, but searching for .htaccess should yield plenty of results.

Welcome to CodeIgniter.

function error - El Forum - 11-28-2008

your right :]

I am not write index.php because i put the .htaccess and do all the things for remove the index.php from
the url.. i will check it again

but why or
is working well? (with out index.php)

thanks Smile

EDIT: only the main page working without index.php
all the other function not working (only with index.php in the url)
on config i make change on $config['index_page'] = "";
and put a .htaccess file on the root floder (where the index.php is) like this:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]