问题描述
我正在使用CodeIgniter 3.0.3,但无法配置 base_url()
。当我将 config.php
文件中的 base_url
设置为 $ config ['base_url' ] ='localhost / codeig303';
,当我打印它时,它会打印 localhost / codeig303 /
,但是当我在<$ c $中使用它时c> href ,然后像 localhost / codeig303 / localhost / codeig303 /
一样重复网址,如果我将其设置为 $ config ['base_url'] ='';
然后返回 http:// :: 1 / codeig303 /
。
I am using CodeIgniter 3.0.3, and I can't config base_url()
. while I am setting the base_url
in config.php
file to $config['base_url'] = 'localhost/codeig303';
and when i print it then it prints localhost/codeig303/
but when i use it in href
then it repeat the url like localhost/codeig303/localhost/codeig303/
, and if I set it to $config['base_url'] = '';
then it returns http://::1/codeig303/
.
,但它在codeigniter 3.0.1中正常工作
but it was working in codeigniter 3.0.1 i was using before
推荐答案
添加 http:
在 localhost
之前,而不是
add http:
before localhost
, instead of
$config['base_url'] = 'localhost/codeig303';
添加此
$config['base_url'] = 'http://localhost/codeig303/';
这篇关于base_url在Codeigniter 3.0.3中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!