当重定向到页面时,css文件,js,图像等都没有加载

时间:2016-10-14 10:00:08

标签: php html css codeigniter

我是codeigniter的新手。实际页面没有问题但是当重定向到页面时,css文件,js,图像等都没有加载

<script   src="<?php echo site_url('resource/js/bootstrap.js'); ?>"></script>
<link href="<?php echo  site_url('resource/css/default.css'); ?>" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href=" <?php echo  site_url('resource/css/tab.css'); ?>" type="text/css" media="screen">
<link rel="stylesheet" href="<?php echo  site_url('resource/css/mob.css'); ?>" type="text/css" media="screen">
<link href="<?php echo  site_url('resource/css/nav.css'); ?>" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="<?php echo  site_url('resource/css/style.css'); ?>" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo  site_url('resource/font/font.css'); ?>" type="text/css" media="screen">

1 个答案:

答案 0 :(得分:1)

我认为您必须将 site_url()替换为 base_url()

echo base_url(); // http://example.com/website
echo site_url(); // http://example.com/website/index.php