目前我試圖刪除codeigniter url上的index.php。我在localhost/jqm/withci上安裝了codeigniter。然後我寫.htaccess刪除index.php,它運作良好。 .htaccess文件:在Codeigniter上刪除index.php的問題沒有加載我的CSS和js
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /jqm/withci/index.php/$1 [L]
但我m having some problem, my css file and js won
噸負荷..我的電腦板是
class Home extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->helpers('url');
}
function index() {
$this->load->view('head_view');
$this->load->view('main_view');
$this->load->view('foot_view');
}
}
我對head_view的看法是:
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>jQuery Mobile with Codeigniter</title>
<link rel="stylesheet" href="<?php echo base_url();?>jquery.mobile/jquery.mobile-1.0a4.1.css" type="text/css" charset="utf-8" />
<script type="text/javascript" src="<?php echo base_url();?>jquery.mobile/jquery-1.5.2.js"></script>
<script src="<?php echo base_url();?>jquery.mobile/jquery.mobile-1.0a4.1.js"></script>
<!-- CDN Respositories: For production, replace lines above with these uncommented minified versions -->
<!-- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />-->
<!-- <script src="http://code.jquery.com/jquery-1.5.2.min.js"></script>-->
<!-- <script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>-->
</head>
<body>
我試圖用BASE_URL(),但它沒有t load my css and js. Thank you.. PS : I
m使用jss Mobile的css和js文件。我們可以從CDN存儲庫加載它,但是我希望從我自己的目錄中加載,以防將來加載自定義css或js
非常感謝.. 這是我的錯,我不知道mod_rewrite .. – justmyfreak 2011-06-10 12:51:23