Php CodeIgniter站点无法承载
我已经开发了一个在localhost上运行完美的站点。但是当我托管Php CodeIgniter站点无法承载,php,css,codeigniter,Php,Css,Codeigniter,我已经开发了一个在localhost上运行完美的站点。但是当我托管css,js,图像和字体时没有链接 你可以在 当一切正常时,它实际上应该是这样的。 这是我的config.php $config['base_url'] = ''; $config['index_page'] = 'index.php'; urlhepler也被加载 文件夹结构如下所示 - root -public html - application - system - assets
css
,js
,图像
和字体
时没有链接
你可以在
当一切正常时,它实际上应该是这样的。
这是我的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\u url()
设置为:
$config['base_url'] = 'http://think-exam.site88.net/';
并且,您可以在应用程序中使用:
<?=base_url()?>assets/images/logo-2.gif
assets/images/logo-2.gif
在您的项目中,您正在使用:
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\u url()
设置为:
$config['base_url'] = 'http://think-exam.site88.net/';
并且,您可以在应用程序中使用:
<?=base_url()?>assets/images/logo-2.gif
assets/images/logo-2.gif
检查您的基本url()我认为这是基本url()问题。请发布您的配置文件数据。注意:在旧版本的codeIgniter中,您可以在config.php中将base_url config留空,但现在在codeIgniter 3及更高版本中,最好在config.php中设置base_url,不要留空。还要确保在新版本的codeIgniter中,只有文件名的第一个字母和类名的大写字母。检查你的基本url()我认为这是基本url()的问题。请发布您的配置文件数据。注意:在旧版本的codeIgniter中,您可以在config.php中将base_url config留空,但现在在codeIgniter 3及更高版本中,最好在config.php中设置base_url,不要留空。还要确保在新版本的codeIgniter中,您只有文件名的第一个字母和类名的大写字母。