没有'index.php'的Codeigniter HMVC

时间:2013-07-19 02:18:48

标签: codeigniter

我在CI 2.1.7中实现了wiredesignz HVMC功能。

唯一的问题是,与我所遵循的教程(http://somethingstatic.com/setting-hmvc-codeigniter-2-1/)不同,我必须在我的网址中添加'index.php':

根据教程应该如何:

http://localhost/site/hmvc

我实际需要打电话:

http://localhost/site/index.php/hmvc

如何配置CI以便不需要'index.php'?

2 个答案:

答案 0 :(得分:2)

//user following code in your .htaccess file to remove index.php from url.
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ ./index.php/$1 [L]

答案 1 :(得分:1)

你不需要做任何额外的事情。 this link将帮助您完成此事。只是正常的程序。我和同一个人做过多次。

希望这会对你有所帮助。

相关问题