你好,這是我的網站鏈接 http://webscarlets.com/ci/welcome笨刪除索引,並添加CSS
我是新來的笨。我從url中刪除了index.php。 要從url中刪除index.php,我使用了下面的代碼。我從codeigniter用戶指南得到這個代碼
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ /ci/index.php/$1 [L]
但是CSS沒有加載。這裏是我的配置設置
//autoload.php
$autoload['helper'] = array('url','form','html');
//config.php
$config['base_url'] = 'http://webscarlets.com/ci/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
//constants.php
define("LAYOUT_URL","http://webscarlets.com/ci/");
//view.sphp
<link rel="stylesheet" type="text/css" href="<?php echo LAYOUT_URL; ?>css/all.css">
請檢閱我的代碼和指南以完成此任務。
感謝所有提前。
首先回聲'base_url()',這樣你就可以確定URL。 – 2012-08-06 10:55:43