ci如何去掉index.php(nginx)
生活随笔
收集整理的這篇文章主要介紹了
ci如何去掉index.php(nginx)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
nginx下ci去掉“index.php”的方法:首先在根目錄下新增“.htaccess”文件;然后修改“nginx.conf”配置文件內容為“ rewrite ^/(.*)$ /index.php/$1;”;最后保存修改即可。
推薦:《PHP視頻教程》
CI框架去除index.php(Nginx)
在根目錄新增.htaccess文件
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
修改nginx.conf(如果有vhost.conf文件,則修改此文件)配置文件
location / {
index index.html index.htm index.php;
#autoindex on;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1;
}
}
總結
以上是生活随笔為你收集整理的ci如何去掉index.php(nginx)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux下安装nginx php
- 下一篇: 短视频运营:短视频创作的5个法则!