nginx去掉index.php 只需2个步骤
1、要捕蕉编辑子站的配置文件
vi /usr/local/nginx/conf/vhost/子站.conf
把 include enable-php.conf 注释掉这行!(或者直接dd删除)
然后在下面新曾一行 添加
include enable-php-pathinfo.conf; #注意后面必须带分号
2、进入目录 付慎 cd /usr/local/nginx/conf/vhost/子站.conf
vi 子站.conf 在你的虚拟主机配置文件server段里添加以下内容:
location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php/$1 last; }}
3、浏览器打开 http://localhost/Home/Index/mod 访问正常!成功去著哨段掉了index.php
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:185
阅读量:161
阅读量:101
阅读量:194
阅读量:88