Apache 2.4 将本地虚拟主机重定向到 https 而不是 http

Apache 2.4 redirecting local virtual host to https instead http

我正在使用 MAC os 和 apache 2.4。我为本地开发创建了一个虚拟 host。这个虚拟 host 正在重定向到 https 而不是简单的 http(我需要它在 http 中工作)。我已经在 chrome 和 safari 上试过了。这是一个 laravel 项目。

这里是httpd-vhosts.conf

的内容
#    ServerAlias www.dummy-host.example.com
#    ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
#    CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common
#</VirtualHost>

#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host2.example.com
#    DocumentRoot "/usr/docs/dummy-host2.example.com"
#    ServerName dummy-host2.example.com
#    ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log"
#    CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common
#</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/Library/WebServer/Documents/onboardera/public"
    ServerName onboardera.dev
    ServerAlias onboardera.dev
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/Library/WebServer/Documents/multi-site/public"
    ServerName multi-site.dev
    ServerAlias multi-site.dev
</VirtualHost>

hosts文件内容如下

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
127.0.0.1       multi-site.dev
127.0.0.1       khan.multi-site.dev
127.0.0.1       onboardera.dev
255.255.255.255 broadcasthost
::1             localhost

Screenshot is also attached

.dev 域属于 google 并且 Google Chrome 推出 v63,现在强制所有 .dev 域使用 HTTPS。

所以您可以尝试其他浏览器或使用 .local.test

可行的选择是切换到 Firefox 作为您的开发浏览器。它速度快,拥有舒适的开发工具,并且在过去几年中确实做出了大量改进。

尝试用户设置 .test 并在没有 www 的情况下调用它 onboardera.test 我遇到了这个问题并进行了上述更改并且对我有效