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

[eluser]swdee[/eluser]
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
Code:
$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/"

Steve

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?
#2

[eluser]swdee[/eluser]
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!!
#3

[eluser]Aken[/eluser]
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.
#4

[eluser]jmadsen[/eluser]
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

#5

[eluser]Aken[/eluser]
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