简体   繁体   中英

wampserver tries to download file after adding new virtual host

My existing wampserver (3.2) virtual hosts work fine, but when I try to add a new one I have problems. Any help apprecaited. I've added the new record to httpd-vhosts.conf:

#
<VirtualHost *:80>
    ServerName newsite
    DocumentRoot "c:/users/offic/onedrive - foldername/studio/domains/newsite"
    <Directory  "c:/users/offic/onedrive - foldername/studio/domains/newsite/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

and I've updated HOSTS (C:\\Windows\\System32\\drivers\\etc) to:

127.0.0.1 newsite
::1 new

(All the sites that work follow the above style) And I've restarted Windows and the DNS in Wampserver.

What actually happens when try to launch newsite in the browser is that it tries to download index.php rather than displaying it. I've also tried adding the new virtual hosts via wamp > localhost > add a new local host. I haven't altered http.conf. As I say, other sites are working fine. Thanks.

So I removed the .htaccess file and things appear to work correctly. Another post said you have to use http://newsite/index.php but I get it fine with newsite/

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