[英]CodeIgniter Site unable to host
I have developed a site which works perfectly on localhost. 我已经开发了一个可以在localhost上完美运行的站点。 But when I'm hosting the
css
, js
, images
and fonts
are not linking. 但是当我托管
css
, js
, images
和fonts
没有链接。
You can check it at http://think-exam.site88.net/ 您可以在http://think-exam.site88.net/上进行检查
It should actually look like this when all is working fine. 当一切正常时,它实际上应该看起来像这样。
Here's My config.php
这是我的
config.php
$config['base_url'] = '';
$config['index_page'] = 'index.php';
url
hepler is also loaded. url
hepler也已加载。
The folder structure is like 文件夹结构就像
- root
-public html
- application
- system
- assets
- css
- js
index.php
Thanks in advance. 提前致谢。
In your project you are using: 在您的项目中,您正在使用:
http://31.170.162.63/
in your site, and i try to access this image: 在您的网站上,我尝试访问此图像:
http://31.170.162.63/assets/images/logo-2.gif
This URL is returning the 404 not found page. 该URL返回404未找到页面。
When i test this URL with same image: 当我使用相同的图片测试此URL时:
http://think-exam.site88.net/assets/images/logo-2.gif
This URL is working fine, as you need. 根据需要,此URL工作正常。
What actually you need: 您实际需要什么:
You need to set the base_url()
in your config.php
file as: 您需要在
config.php
文件中将base_url()
设置为:
$config['base_url'] = 'http://think-exam.site88.net/';
And than you can use in your application as: 然后,您可以在应用程序中将其用作:
<?=base_url()?>assets/images/logo-2.gif
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.