如何在CodeIgniter中更新/更改分页的base_url?

I'm new to CodeIgniter. I have populated some categories to a view, and the category ID is passing through the URL to the controller then to the model.

I also need to integrate the pagination. For that I have done the base_url like so:

$config['base_url'] = base_url() . "kc_directory/categoryloader/";

But when I click on the pagination link, it's returning the following link:

localhost/kc_directory/categoryloader/2

When I modify the above link to localhost/kc_directory/categoryloader/2/?value1=1 it works, where value1 is the variable name and 1 is the category ID.

How do I change the base_url to achieve this ?

Change base url settings

config it like

$config['base_url'] = 'http://example.com/';

if you work in localhost

config it like

$config['base_url']= 'http://localhost/YourFolderName/';

You can customize your base url in application/config/config.php:

$config['base_url'] = 'https://hostname.com/';

Thank you guys.. fixed....

$config['suffix'] = '/?value1='.$value1; $this->pagination->initialize($config);

This worked...

Thanks :)