CI 框架 伪静态设置 去掉index.php

.htaccess文件修改

DirectoryIndex index.php

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|themes|uploads|uploads_thumb|robots\.txt)

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

 

config/config.php中:

$config['uri_protocol'] = "AUTO"; //或者是PATH_INFO

 

上一篇:Vue.js项目在apache服务器部署后,刷新404的问题


下一篇:配置 .htaccess让阿里云虚拟主机支持多个域名