关于Code Igniter和MySql:
如何通过htaccess隐藏url中的index.php?
答案 0 :(得分:5)
在您的文档根目录中,包含以下内容的.htaccess
文件:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt) # these are examples,
# add everything here that
# you **don't** want to be
# routed to CI
RewriteRule ^(.*)$ /index.php/$1 [L]
然后在application/config/config.php
更改:
$config['index_page'] = '';