微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

隐藏本地主机路径名XAMPP

如何解决隐藏本地主机路径名XAMPP

您好,我正在寻找一种有效的方法来隐藏XAMPP LOCALHOST中的路径文件

例如,认路径为[对于wordpress文件]

localhost/wordpress

我怎么把它变成

localhost only without the /wordpress file path ? 

我厌倦了将DNS本地主机添加到==>

主机文件

C:\Windows\System32\drivers\etc

喜欢

127.0.0.1            testing.com

并将其添加到httpd-vhosts.conf

认端口为== 80

<VirtualHost *:8010> 
  DocumentRoot "F:\DEV\htdocs\wordpress" 
  ServerName testing.com
  ServerAlias testing.com
     <Directory "F:\DEV\htdocs\wordpress> 
        Require all granted 
     </Directory> 
</VirtualHost>

当我输入== testing.com时[将我重定向到testing.com/dashboard-testing.com/wordpress

我只需要test.com

我使用

XAMPP控制面板V3.2.4

Apache服务器

MysqL数据库

wordpress框架== 5.5.1

解决方法

请尝试以下代码,这可能会对您有所帮助。

添加此行在主机文件中 127.0.0.1 testing.com

我刚刚测试了这段代码,并且可以正常工作

httpd-vhosts.conf

中的此代码
<VirtualHost *:80>  ## i have removed 10 from port and it was working in mine
  DocumentRoot "D:/xampp/htdocs/wordpress" 
  ServerName testing.com
  ServerAlias testing.com
     <Directory "D:/xampp/htdocs/wordpress> 
        Require all granted 
     </Directory> 
</VirtualHost>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。