CI 框架 僞靜態設置 去掉index.php

.htaccess文件修改php

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中:spa

$config['uri_protocol'] = "AUTO"; //或者是PATH_INFO
相關文章
相關標籤/搜索