Welcome Guest, Not a member yet? Register   Sign In
Newbie route problem

I'm starting out and doing the Static Page part of the tutorial.
To remove "index.php" from urls I've set in router.php
$route['default_controller'] = 'pages/view';
$route['(:any)'] = 'pages/view/$1';

I echo the page being recieved ($1) in the pages controller.
When I goto "http://localhost/ci/" it echoes "home", but going to "http://localhost/ci/about" it echoes "ci".

What am I doing wrong?
The base url is "http://localhost/ci/"


p.s: another quick question, when I upload all my files to my remote server is it just a case of changing the base url to my domain name?

I've actaully solved the problem myself now, in config.php I had to change $config['uri_protocol'] = 'AUTO'; (it's default setting) to $config['uri_protocol'] = 'PATH_INFO';

Please can this be in the tutorial, that would have saved me 3 hours of frustration!!

The URI protocol will depend on server settings. It shouldn't be added to the tutorial because it is only applicable to specific situations. Glad you found the answer, though.

Well, if it is a tutorial for new CI users & the code they are showing is dependent on a setting somewhere else, they should at least stick in a troubleshooting block.

Most people wouldn't think to check that config; they would either come here and ask or just give up


If we documented quirks for every server environment we knew about, the documentation would be huge. That's what the forum is for.

Theme © iAndrew 2016 - Forum software by © MyBB