请问如何去掉URL中的index.php,增加html后缀啊
请问如何去掉URL中的index.php,还有增加html后缀啊。http://localhost/my_blog/index.php/product/shoes/123 如果不输入index.php.就无法选择控制器。请问用什么办法去掉index.php。还有,如何在末尾加上.html。我按照指南上修改过,但总是不成功。求解,谢谢。我用的是CI2.02 .htcaccess Rooting 发表于 2011-9-27 17:48 static/image/common/back.gif.htcaccess
我修改了.htcaccess 还是不能去掉index.php
RewriteEngine on
RewriteRule ^(.*)$ $1 正确 {:soso_e182:} .htcaccess 或者 rewrite 去除 index.php,那个 html 我是用后缀实现的,就是做 url 的时候有点小麻烦。 本帖最后由 thenbsp 于 2012-1-9 22:38 编辑
手册上有啊,具体看我博客吧
详解:http://www.thenbsp.com/view-codeigniter-remove-index/
我博客也是 CI 开发的,刚上线。
http://codeigniter.org.cn/forums/thread-4-1-2.html
这里有答案,如何去掉index.php
但是加.html我不会 config.php /*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/urls.html
*/
$config['url_suffix'] = ''; .htaccess
RewriteEngine on
RewriteBase /my_blog/
RewriteRule ^(.*)\.html$ index.php/$1
页:
[1]
2