【问题标题】:hide the localhost path name XAMPP隐藏本地主机路径名 XAMPP
【发布时间】:2021-02-14 12:47:05
【问题描述】:

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

例如默认路径是 [对于 Wordpress 文件]

localhost/wordpress

我怎样才能把它变成

localhost only without the /wordpress file path ? 

我厌倦了将 dns localhost 添加到 ==>

宿主文件在

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

我只需要它 testing.com

我使用

XAMPP控制面板V3.2.4

Apache 服务器

MySQL 数据库

Wordpress 框架 == 5.5.1

【问题讨论】:

  • ................

标签: wordpress xampp localhost


【解决方案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>

【讨论】:

    猜你喜欢
    • 2020-10-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-02
    • 1970-01-01
    • 2017-10-23
    • 2017-11-06
    相关资源
    最近更新 更多