2013-07-03 24 views
0

我有關於將Smarty 3.1.14集成到CodeIgniter 2.1.3的教程,除了我的鏈接外,當我嘗試在我的smarty文件之間導航時,去前:http://local.host/project/index.php/Smartytest < - 我需要做的就是避免在index.php,只是進入的//local.host/project/SmartytestCodeigniter 2.1.x + Smarty 3.1.x集成

在我的測試,它說:

$ SCRIPT_NAME是/ cismarty-new/index.php

我只是想隱藏index.php所以我可以做/ cismarty-new/Smartytest for例如,代替/cismarty-new/index.php/Smartytest

感謝

+0

可能重複,http://stackoverflow.com/search?q=%5Bcodeigniter%5D+remove+index.php – Aurel

+0

不是重複它不是同一個問題,我已經整合CI + Smarty,與codeigniter索引.php沒有出現,我可以去本地主機/網站/歡迎和它的工作正常,但是當我嘗試與Smarty我必須把本地/網站/ index.php /歡迎顯示它是真正的問題 –

+0

你試試在** config.php **中設置'index_page'配置? – Aurel

回答

0

你試圖使用的.htaccess?

,如果你還沒有嘗試過那麼做打鳥,看看它是否解決了問題:

創建文件夾的根目錄中的.htaccess文件(內cismarty新/),複製代碼,並將其保存。

RewriteEngine on 
RewriteBase /cismarty-new 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* index.php/$0 [PT,L] 

然後打開笨的config.php並留下$配置[ 'index_page']空白:

$config['index_page'] = ''; 

PS:記住要檢查,如果你有Apache的 「rewrite_module」 激活,否則會不行。