Welcome Guest, Not a member yet? Register   Sign In
Clean URLs on a new install.
#1

[eluser]Unknown[/eluser]
I'm a web developer who's brand new to the CodeIgniter framework so I am most likely doing something horribly wrong but for some reason I'm unable to pass values outside of the controller name via URL segments. My development environment is Apache 2.0/PHP 5.2.6 on Windows and I'm eventually pushing to a RHEL environment with Apache 1.3/PHP 5.2.3.

Incongruancies between my development and production environments aside I'm having a show-stopper problem with clean URLs causing 404s after advancing to the next segment in the URL.

Forgive me if this has been covered before, but I've not found anything on the forums addressing the same issue. For giggles, allow me to privide an example.

The controller "Sample" accepts two URI segments which it then echoes back. The URL to run this bit of script is http://example.com/index.php/sample/foo/bar

In my install tested against both development and production environments navigating to the controller call (http://example.com/index.php/sample) displays as expected (without the segment data displaying as blank of course) however once you include the segments indexed at 2 and 3 (or just 2) CI reports a 404.

Code:
<?php
class Sample extends Controller {

    function index()
    {
        echo 'Display this message to verify ';
        echo $this->uri->segment(2) . ', ';
        echo $this->uri->segment(3) . ', ';
        
    }
}

Am I missing an option in the configuration? Is it the version of PHP I'm using. I'm unsure what the problem is, but I'm sure someone else has to have had this issue in the past.

Thanks to anyone who can help me with this (likely simple) issue that I'll probably feel stupid for not catching.
#2

[eluser]Unknown[/eluser]
I see where I've messed up. I misread the documentation on URLs now I'm on board.




Theme © iAndrew 2016 - Forum software by © MyBB