我知道這已被問過很多次,但以前的解決方案/答案不起作用。從CodeIgniter多個子目錄中刪除「index.php」
我已經查看了這些:
- Remove index.php From URL - Codeigniter 2
- mod_rewrite to remove index.php from Codeigniter in subdirectory
- Using htaccess to remove codeigniter index.php in a subdirectory
我已經在過去成功地使用這些解決方案,但這種安裝是給我的問題。我想這可能不止是一個.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.這些參數
('AUTO', 'PATH_INFO', 'QUERY_STRING', 'REQUEST_URI', and 'ORIG_PATH_INFO')
一個替換以下變量你說你是 「90%確定」。你可以使用'apache_get_modules()'或其他東西100%確定嗎? 2.你的RewriteRule缺少public_html,這是故意的嗎? – glomad1.我運行了該功能,並且確實已安裝。 2.我用public_html嘗試,沒有區別。 – Phil
當您從URL中刪除index.php時,您能發佈確切的錯誤消息嗎? (它可能在apache錯誤日誌或CI應用程序日誌中。) – glomad