1.在codeigniter目录下创建一个.htaccess文件,代码如下
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ex/
RewriteCond $1 ^(application|system|private|logs)
RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]
RewriteCond $1 ^(index\.php|robots\.txt|opensearch\.xml|favicon\.ico|assets|forums)
RewriteRule ^(.*)$ - [PT,L]
RewriteRule ^(.*)$ index.php/$1 [PT,L]
</IfModule>
2.并更改config['index_page']='index.php'
为config['index_page']=''
但它不工作。我的 httpd.conf(/etc/apache2/) 是空白的