WAMP Virtualhost not working with Laravel instance

前端 未结 1 610
礼貌的吻别
礼貌的吻别 2020-12-12 07:58

I\'m working on a Laravel project locally using WAMP 3.1.0 and everything was working correctly until there was a windows update today.

When I go to my project I get

相关标签:
1条回答
  • 2020-12-12 08:22

    The first thing you should know is that the .dev tLD is now a real tLD and has been bought by Google. So as of Chrome 63 (out since December 2017), Chrome itself will force all domains ending on .dev (and .foo) to be redirected to HTTPS via a preloaded HTTP Strict Transport Security (HSTS) header.

    So we should all stop using .dev and use something else, suggestions are to use .localhost or .test.

    A simple test for this would be to try using FireFox or IE instead of Chrome to access your current configured site. If it runs in another browser, some of your problem is related to the Chrome changes that redirect .dev domains automatically.

    Secondly, your Virtual Host definitions are not good. For some time now in WAMPServer there has been a tool provided within WAMPServer to help you create Virtual Hosts easily and correctly. Look at the WAMPSever homepage under the Tools menu for a link called Add Virtual Host (see below).

    All you need to do is first create the folder that you want the site to live in before running the "Add Virtual Host" tool.

    I suggest you revert your httpd-vhosts.conf file back to its initial state which contains only a definition for localhost

    #
    # Virtual Hosts
    #
    
    <VirtualHost *:80>
        ServerAdmin admin@example.com
        ServerName localhost
        DocumentRoot "${INSTALL_DIR}/www"
        <Directory "${INSTALL_DIR}/www/">
            Options +Indexes +FollowSymLinks +MultiViews
            AllowOverride All
            Require local
        </Directory>
    </VirtualHost>
    

    And then using the "Add Virtual Host" menu, create your Virtual Hosts again, but this time using paycafe.localhost for example.

    0 讨论(0)
提交回复
热议问题