Home >Backend Development >PHP Problem >How to hide index.php in xampp

How to hide index.php in xampp

藏色散人
藏色散人Original
2021-10-19 11:24:022087browse

xampp method to hide index.php: 1. Configure httpd-vhosts.conf and httpd.conf files; 2. Open the local host file and add the virtual domain name at the end of the file.

How to hide index.php in xampp

The operating environment of this article: macOS10.15.4 system, thinkphp v5.0.7 && XAMPP (PHP) version 5.6.30, MacBook Air 2019 computer

How does xampp hide index.php?

MAC XAMPP TP5 virtual domain name hidden index.php

1. Configure Apache /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf file

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. Configure Apache /Applications/XAMPP/xamppfiles/etc/httpd.conf

sudo vim /Applications/XAMPP/xamppfiles/etc/httpd.conf
# Virtual hosts //开启虚拟主机配置
Include etc/extra/httpd-vhosts.conf  //去掉该语句前的#号

3. Configure the local host file

sudo vim /etc/hosts
//在文件末尾添加虚拟域名配置
127.0.0.1 cm.com

If the index.php entry file cannot be hidden, possible reasons The virtual domain name is illegal, just reset the virtual domain name

Recommended study: "PHP Video Tutorial"

The above is the detailed content of How to hide index.php in xampp. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn