您好,欢迎访问一九零五行业门户网

xampp怎么隐藏index.php

xampp隐藏index.php的方法:1、配置httpd-vhosts.conf和httpd.conf文件;2、打开本机host文件,并在文件末尾添加虚拟域名即可。
本文操作环境:macos10.15.4系统、thinkphp v5.0.7 && xampp(php)5.6.30版、macbook air 2019电脑
xampp怎么隐藏index.php?
mac + xampp + tp5 + 虚拟域名 + 隐藏index.php
1、配置apache /applications/xampp/xamppfiles/etc/extra/httpd-vhosts.conf 文件
sudo vim /applications/xampp/xamppfiles/etc/extra/httpd-vhosts.conf //处理多站点localhost访问<virtualhost *:80> documentroot "/applications/xampp/xamppfiles/htdocs" servername localhost</virtualhost>//<virtualhost *:80> documentroot "/applications/xampp/xamppfiles/htdocs/zerg/public"//替换为自己的网站根目录 servername cm.com //替换为自己的虚拟域名</virtualhost>
2、配置apache /applications/xampp/xamppfiles/etc/httpd.conf
sudo vim /applications/xampp/xamppfiles/etc/httpd.conf# virtual hosts //开启虚拟主机配置include etc/extra/httpd-vhosts.conf //去掉该语句前的#号
3、配置本机host文件
sudo vim /etc/hosts//在文件末尾添加虚拟域名配置127.0.0.1 cm.com
如果无法隐藏index.php入口文件,可能原因是虚拟域名不合法,重新设置虚拟域名即可
推荐学习:《php视频教程》
以上就是xampp怎么隐藏index.php的详细内容。
其它类似信息

推荐信息