首页 > PHP资讯 > PHP培训技术 > CodeIgniter框架url去index.php

CodeIgniter框架url去index.php

PHP培训技术

针对a 去掉url中index.php

.htaccess内容如下:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f   #这个重要,保证css,js正常加载

RewriteCond $1 !^(index\.php|images|robots\.txt)

RewriteRule ^(.*)$ /index.php/$1 [L]

然后找到application/config/config.php文件:

将$config['index_page'] = "index.php";改为$config['index_page'] = "";

PHP培训技术

本文由欣才IT学院整理发布,未经许可,禁止转载。
支持44不支持0