隐藏本地主机路径名XAMPP

时间:2020-11-01 18:58:42

标签: wordpress xampp localhost

您好,我正在寻找一种有效的方法来隐藏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

1 个答案:

答案 0 :(得分:0)

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

添加此行在主机文件中 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>
相关问题