2013-07-03 22 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” 激活,否则会不行。