在xampp中创建子域的最佳且简单的方法是什么

在xampp中创建子域的最佳且简单的方法是什么,xampp,Xampp,我想创建或添加本地子域,如test.localhost.com, 你能帮我吗 我试图将此域添加到我的windows主机文件中 127.0.0.1 test.localhost.com 它显示页面不工作,我能做什么?首先我想告诉您,windows主机文件只能重定向到指定IP地址,但默认情况下,localhost.com在xampp中未打开,因此您必须手动添加localhost.com 转到C:\xampp\apache\conf\extra\httpd vhosts.conf并将此代码粘贴到页脚

我想创建或添加本地子域,如test.localhost.com, 你能帮我吗

我试图将此域添加到我的windows主机文件中

127.0.0.1 test.localhost.com

它显示页面不工作,我能做什么?

首先我想告诉您,windows主机文件只能重定向到指定IP地址,但默认情况下,localhost.com在xampp中未打开,因此您必须手动添加localhost.com

转到
C:\xampp\apache\conf\extra\httpd vhosts.conf
并将此代码粘贴到页脚

# FOR test 
NameVirtualHost test:80 
<VirtualHost *:80> 
<Directory "C:/xampp/htdocs/test"> 
    Options FollowSymLinks Indexes 
    AllowOverride All 
    Order deny,allow 
   allow from All 
</Directory> 
ServerName test 
ServerAlias www.test 
DocumentRoot "C:/xampp/htdocs/test" 
</VirtualHost> 
#用于测试
名称虚拟主机测试:80
选项跟随符号链接索引
允许超越所有
命令拒绝,允许
通融
服务器名测试
服务器别名www.test
DocumentRoot“C:/xampp/htdocs/test”
然后转到
C:\Windows\System32\drivers\etc\hosts
,并像前面一样使用此代码给出重定向方向。 将此代码粘贴在底部


127.0.0.1测试

首先,我想告诉您,windows主机文件只能重定向到指定IP地址,但默认情况下,localhost.com在xampp中未打开,因此您必须手动添加localhost.com

转到
C:\xampp\apache\conf\extra\httpd vhosts.conf
并将此代码粘贴到页脚

# FOR test 
NameVirtualHost test:80 
<VirtualHost *:80> 
<Directory "C:/xampp/htdocs/test"> 
    Options FollowSymLinks Indexes 
    AllowOverride All 
    Order deny,allow 
   allow from All 
</Directory> 
ServerName test 
ServerAlias www.test 
DocumentRoot "C:/xampp/htdocs/test" 
</VirtualHost> 
#用于测试
名称虚拟主机测试:80
选项跟随符号链接索引
允许超越所有
命令拒绝,允许
通融
服务器名测试
服务器别名www.test
DocumentRoot“C:/xampp/htdocs/test”
然后转到
C:\Windows\System32\drivers\etc\hosts
,并像前面一样使用此代码给出重定向方向。 将此代码粘贴在底部

127.0.0.1测试