gpt4 book ai didi

php - CodeIgniter 站点无法托管

转载 作者:太空宇宙 更新时间:2023-11-04 02:32:45 24 4
gpt4 key购买 nike

我开发了一个可以在本地主机上完美运行的站点。但是当我托管 css 时,jsimagesfonts 没有链接。

可以在http://think-exam.site88.net/查看

当一切正常时,它实际上应该是这样的。 when hosted on localhost

这是我的 config.php

$config['base_url'] = '';

$config['index_page'] = 'index.php';

url hepler 也被加载。

文件夹结构是这样的

- root
-public html
- application
- system
- assets
- css
- js
index.php

提前致谢。

最佳答案

在您的元素中您正在使用:

http://31.170.162.63/

在你的网站上,我尝试访问这张图片:

http://31.170.162.63/assets/images/logo-2.gif

此 URL 返回 404 未找到页面。

当我用相同的图片测试这个 URL 时:

http://think-exam.site88.net/assets/images/logo-2.gif

这个 URL 工作正常,正如您所需要的。

您实际需要什么:

您需要将 config.php 文件中的 base_url() 设置为:

$config['base_url'] = 'http://think-exam.site88.net/';

而且你可以在你的应用程序中使用:

<?=base_url()?>assets/images/logo-2.gif

关于php - CodeIgniter 站点无法托管,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36232508/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com