2013-01-24 89 views
2

我知道這已被問過很多次,但以前的解決方案/答案不起作用。從CodeIgniter多個子目錄中刪除「index.php」

我已經查看了這些:

我已經在過去成功地使用這些解決方案,但這種安裝是給我的問題。我想這可能不止是一個.htaccess問題。

說明

我的文件夾設置如下:/home/~username~/public_html/~company~/index.php。我的$config['index_page']設置爲"",我的服務器啓用了mod_rewrite。我正在使用CI version, 2.1.3

.htaccess文件位於與application文件夾相同的文件夾中。

問題

我似乎無法刪除從我的網址index.php沒有應用斷裂。我嘗試了很多很多的設置,包括CI網站上提供的設置。

我不知所措。如果這不是我的.htaccess文件,它可能是什麼?如果這是我的.htaccess文件,我在做什麼錯了?我最新的嘗試是這些:

RewriteEngine On 
RewriteBase/
RewriteCond $1 !^(index\.php) [NC]  
RewriteRule ^(.*)$ /home/username/company/index.php/$1 [L] //absolute path 
and 
"" 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ company/index.php/$1 [L] 

完全apache錯誤:

[Thu Jan 24 18:22:13 2013] [error] [client ip ] 
File does not exist: /home/username/public_html/company/home 
+1

1.這些參數('AUTO', 'PATH_INFO', 'QUERY_STRING', 'REQUEST_URI', and 'ORIG_PATH_INFO')一個替換以下變量你說你是 「90%確定」。你可以使用'apache_get_modules()'或其他東西100%確定嗎? 2.你的RewriteRule缺少public_html,這是故意的嗎? – glomad

+0

1.我運行了該功能,並且確實已安裝。 2.我用public_html嘗試,沒有區別。 – Phil

+0

當您從URL中刪除index.php時,您能發佈確切的錯誤消息嗎? (它可能在apache錯誤日誌或CI應用程序日誌中。) – glomad

回答

0

設置變量空,如下。

$config['index_page'] = '';

嘗試通過一個

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

+0

什麼'.htaccess'配置? – Phil

+0

與應用程序文件夾 –

+0

位於同一文件夾中的文件夾是什麼意思?我想弄清楚我應該使用什麼'.htaccess'文件設置。 – Phil