현재 codeigniter url에서 index.php를 제거하려고했습니다. 내 codeigniter를 localhost/jqm/withci에 설치했다. 그런 다음 .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
t 부하 .. 내 conroller은
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()를 사용하려고하지만, 그것은 jQuery 모바일에 대한 CSS와 JS 파일을 사용하여 t load my css and js. Thank you.. PS : I
m 않았다. CDN 리포지토리에서로드 할 수 있지만 나중에 사용자 정의 CSS 또는 js를로드하려는 경우 내 자신의 디렉토리에서로드 가능하게하려고합니다.
대단히 감사합니다. 그것은 mod_rewrite 잘 모르겠다 내 잘못이야. – justmyfreak