CodeIgniter Forums
Newbie route problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Newbie route problem (/showthread.php?tid=55875)



Newbie route problem - El Forum - 11-14-2012

[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?


Newbie route problem - El Forum - 11-14-2012

[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!!


Newbie route problem - El Forum - 11-14-2012

[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.


Newbie route problem - El Forum - 11-15-2012

[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




Newbie route problem - El Forum - 11-15-2012

[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.