简体   繁体   中英

Apache 2.4 redirecting local virtual host to https instead http

I'm using MAC os and apache 2.4. I have created a virtual host for my local development. This virtual host is redirecting to https instead of simple http (I need it to work in http). I have tried it on chrome and safari. It's a laravel project.

Here is the content of 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>

Following is the content of hosts file.

##
# 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 domains belongs to google and Google Chrome is rolled out v63 that now forces all .dev domains to use HTTPS.

So either You can try some other browser or use .local or .test

Viable option is to switch to Firefox as your development browser. It's fast, has comfortable dev tools, and has really made a ton of improvements over the past few years.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM