[英]Codeigniter: error in base_url
i have one problem with function base_url() in my codeigniter. 我在我的codeigniter中有一个函数base_url()的问题。
I'm configure the condeigniter to: 我将condeigniter配置为:
$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. 可以,但是当我尝试在页面中使用base_url('clientes')时,链接会重复。
example, i wanna this : localhost/sistema_clientes/example. 例如,我想这样: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
在我的网址中,链接转到:
http://localhost/sistema_clientes/sistema_clientes/clientes
but i wanna this: http://localhost/sistema_clientes/clientes
但我想这样:
http://localhost/sistema_clientes/clientes
i don't wanna the base_url() repeat the sistema_clientes, please help me. 我不希望base_url()重复sistema_clientes,请帮助我。
what i can do to repear this? 我该怎么做才能重现这一点?
Thanks. 谢谢。
Set your base_url
like below: 如下设置您的
base_url
:
$config['base_url'] = 'http://localhost/sistema_clientes/';
Because setting $config['base_url'] = 'sistema_clientes/';
因为
setting $config['base_url'] = 'sistema_clientes/';
makes sense that you are going to sistema_clientes
controller so base_url becomes http://localhost/sistema_clientes/sistema_clientes
. 您将要转到
sistema_clientes
控制器是有意义的,因此base_url变为http://localhost/sistema_clientes/sistema_clientes
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.