CodeIgniter css樣式不顯示問題

來源:互聯網
上載者:User
這是我的引用css的代碼
<?php echo $title ?> - News

News


這是我的config.php的檔案
$config['base_url']= 'http://127.0.0.1/myPhpStudy/index.php/';

這是產生頁面後的原始碼,點擊href串連顯示404,我懷疑可能路徑錯誤,可是我不知道哪裡錯了
    Create a news item - News

News

Create a news item

Title

Text

wsdfsfdsa

我的css檔案夾和header.php頁面都是在news檔案夾下面的,不知道到底哪裡錯了,請大牛指點啊,本人是剛剛接觸php的


回複討論(解決方案)


這是有效地路徑嗎?
難道 index.php 是目錄?

$config['base_url'] = 'http://127.0.0.1/myPhpStudy/index.php/';
是路徑

" />試試?

" />試試?


不行啊

href=""這個在頁面上列印出來的串連發出來看看

href=""這個在頁面上列印出來的串連發出來看看


href="http://127.0.0.1/myPhpStudy/index.php/css/yangshi.css" />

 

 


這個也不行啊

貼出的的目錄結構
並指出你的檔案的位置

在網站直接輸入http://127.0.0.1/myPhpStudy/index.php/css/yangshi.css能訪問嗎?是不是css這個目錄限制訪問的?

在網站直接輸入http://127.0.0.1/myPhpStudy/index.php/css/yangshi.css能訪問嗎?是不是css這個目錄限制訪問的?


顯示404 Page Not Found

貼出的的目錄結構
並指出你的檔案的位置

執行的檔案為 myPhpStudy/index.php
樣式表在 myPhpStudy/application/css 中
所以樣式表的路徑應為
dirname($this->config->item('base_url')) . '/application/css/'

執行的檔案為 myPhpStudy/index.php
樣式表在 myPhpStudy/application/css 中
所以樣式表的路徑應為
dirname($this->config->item('base_url')) . '/application/css/'


這個也不行,這個連接點開後是404 Page Not Found

我在myPhpStudy下面加上.htaccess檔案,然後訪問就會出現Internal Server Error
RewriteEngine On
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

謝謝你們,問題已經解決了,是wampserver下面的一個設定檔出錯了

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.