【问题标题】:Code Igniter issue with base_urlbase_url 的 Codeigniter 问题
【发布时间】:2014-06-01 18:47:51
【问题描述】:

我将使用两种语言的代码点火器页面从 windows 上的 xampp 移动到使用 lighttpd 的树莓派。

现在,我的base_url 似乎无法正常工作。
base_url 应该是“http://raspberry.local/test/”但是当我输入它时,所有链接都被破坏了。
当我将base_url 更改为“http://raspberry.local/test/index.php”时,链接会起作用。它们看起来像“http://raspberry.local/test/index.php/link/”,但图片链接现在已损坏。
图片是这样加载的:

<img src="<?php echo base_url("/images/starte.png") ?>" alt="Start-Image" class="precomposed">

有什么建议吗?

【问题讨论】:

  • 您是否正在更改index.php.htaccess 中的查看?
  • 我正在使用 lighttpd,所以 .htaccess 不起作用。

标签: php codeigniter hyperlink uri lighttpd


【解决方案1】:

这就是我们需要如何使用这个base_url()

<img src="<?php echo base_url() ?>images/starte.png" alt="Start-Image" class="precomposed">

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-12-09
    • 1970-01-01
    • 1970-01-01
    • 2018-07-26
    • 1970-01-01
    • 2015-07-09
    • 2018-11-08
    相关资源
    最近更新 更多