I am beginner in Codeigniter
.
I have downloaded the software and tried to configure it. How can I configure a base url to use in codeigniter?

如何在codeigniter中的config.php文件中设置config_base url?
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
5条回答 默认 最新
- dt102282 2016-11-08 05:53关注
You should got to this file path
Codeigniter/applications/config/config.php
Search for this line that contains
$config['base_url'] = ""
Then your base_url should be
$config['base_url'] = "http://yoursite.com/"
If xampp, it should be
$config['base_url'] = "http://localhost/yoursite/"
And if wamp, it should be
$config['base_url'] = "http://www/yoursite/"
Note that yoursite is the filename of the site folder you have in htdocs or www folder
When you make use of
<?php echo base_url(directory/file_name); ?>
In your views, it should output something like:"http://localhost/yoursite.com/directory/file_name"
That should do the trick
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报