0

i have one problem with function base_url() in my codeigniter.

I'm configure the condeigniter to:

$config['base_url'] = 'sistema_clientes/';

$config['index_page'] = '';

and autoload to:

$autoload['helper'] = array('url');

It's ok, but when i'm try to use base_url('clientes') in my pages, the link repeat.

example, i wanna this : localhost/sistema_clientes/example.

<li><a href="<?= base_url('example'); ?>">Example</a></li>

in my url, the link go to: http://localhost/sistema_clientes/sistema_clientes/clientes

but i wanna this: http://localhost/sistema_clientes/clientes

i don't wanna the base_url() repeat the sistema_clientes, please help me.

what i can do to repear this?

Thanks.

1 Answer 1

1

Set your base_url like below:

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

Because setting $config['base_url'] = 'sistema_clientes/'; makes sense that you are going to sistema_clientes controller so base_url becomeshttp://localhost/sistema_clientes/sistema_clientes.

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

1 Comment

glad to help happy coding.

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.