0

My function in users class:

public function form($a = false, $b = false, $c= false)
{
   // Something to do
}

My request uri:

..admin/users/form/1/2/3

I'm getting 404 error:

404 Page Not Found

The page you requested was not found.

But If i try alphabetical characters like admin/users/form/1/something/1 instead of numeric 2 or 1 places, it works.

So;

..admin/users/form/1/2   > works
..admin/users/form/1/2/3 > not work
..admin/users/form/a/2/3 > works
..admin/users/form/1/a/3 > works
..admin/users/form/1/2/a > not work

And i tried with custom routes and remapping but again i couldnt figure out the issue.

1 Answer 1

1

Have you tried

$route['admin/users/form(/:any)*'] = 'admin/users/form';

Then use uri segments in your controller:

public function form()
{
   $a = $this->uri->segment(4);
   $b = $this->uri->segment(5);
   $c = $this->uri->segment(6);
}

I'm not sure why your initial setup isn't working because I always use routes this way. Works fine for me.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the answer. I was using custom routing but i didnt expect because of custom function. And i fixed now. Thanks again for efforts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.