2009-02-19 169 views
0

我在使用CodeIgniter工作在我的共享主機帳戶時遇到問題。網址是http://test.tallgreentree.com。它沒有給我一個.php錯誤,但它顯示了我輸入地址欄的所有內容的404頁面。CodeIgniter安裝問題

這是我的config.php文件的開頭。

<?php if (! defined('BASEPATH')) exit('No direct script access allowed'); 

/* 
|-------------------------------------------------------------------------- 
| Base Site URL 
|-------------------------------------------------------------------------- 
| 
| URL to your CodeIgniter root. Typically this will be your base URL, 
| WITH a trailing slash: 
| 
| http://example.com/ 
| 
*/ 
$config['base_url'] = "http://test.tallgreentree.com/"; 

/* 
|-------------------------------------------------------------------------- 
| Index File 
|-------------------------------------------------------------------------- 
| 
| Typically this will be your index.php file, unless you've renamed it to 
| something else. If you are using mod_rewrite to remove the page set this 
| variable so that it is blank. 
| 
*/ 
$config['index_page'] = "index.php"; 

/* 
|-------------------------------------------------------------------------- 
| URI PROTOCOL 
|-------------------------------------------------------------------------- 
| 
| This item determines which server global should be used to retrieve the 
| URI string. The default setting of "AUTO" works for most servers. 
| If your links do not seem to work, try one of the other delicious flavors: 
| 
| 'AUTO'   Default - auto detects 
| 'PATH_INFO'  Uses the PATH_INFO 
| 'QUERY_STRING' Uses the QUERY_STRING 
| 'REQUEST_URI'  Uses the REQUEST_URI 
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO 
| 
*/ 
$config['uri_protocol'] = "AUTO"; 

將CodeIgniter與子域一起使用時是否存在已知問題?什麼可能導致這個?我試過多種配置,但似乎沒有任何工作適合我。我應該向託管服務提供商查詢哪些服務器設置?

謝謝大家的時間和協助。

+0

您是否嘗試過在該目錄中訪問其他東西嗎?一個圖像也許? – Sampson 2009-02-19 18:14:33

回答

1

變化

$config['uri_protocol'] = "AUTO"; 

$config['uri_protocol'] = "REQUEST_URI" 

,看看能否解決

也,你有沒有類控制器名稱相同的文件名?

名= test.php的

class Test ... 
+0

我已經做出了改變,仍然沒有喜樂。我使用默認控制器和視圖的Codeigniter 1.7.1。我沒有改變這些文件。控制器名稱和文件名稱匹配。 – TallGreenTree 2009-02-19 18:58:13

0

我這正與「REQUEST_URI」但當時我只能打到我的主頁。所有其他鏈接(控制器)始終刷新到主頁。它有點奇怪,它顯示正確的網址,但無論您點擊哪個網址,都會將您帶到主頁。

任何想法?我有一個.htaccess文件,

RewriteEngine敘述上 RewriteBase/testci 的RewriteCond%{REQUEST_URI} ^系統。* 重寫規則^()$ /index.php/$1 [L] 的RewriteCond%{REQUEST_FILENAME }!-f RewriteCond%{REQUEST_FILENAME}!-d RewriteRule ^(。)$ index.php/$ 1 [L] RewriteCond $ 1!^(index.php | images | captcha | css | js | robots.txt ) addType text/css .css

1

Make 2在config.php文件中的更改

第一個是:

`$config['uri_protocol'] = "AUTO";` 

`$config['uri_protocol'] = "REQUEST_URI"` 

第二個是:

$config['index_page'] = 'index.php'; 

$config['index_page'] = 'index.php?';