這是我的引用css的代碼
<?php echo $title ?> - NewsNews
這是我的config.php的檔案
$config['base_url']= 'http://127.0.0.1/myPhpStudy/index.php/';
這是產生頁面後的原始碼,點擊href串連顯示404,我懷疑可能路徑錯誤,可是我不知道哪裡錯了
Create a news item - NewsNews
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下面的一個設定檔出錯了