简体   繁体   中英

Apache (wampserver 3.2 on W10) virtual host is redirecting to an external url instead of the local folder

Our website is stored on a Dropbox folder on my PC so that I can mess with it to my heart's content and only then upload it to our ISP/host once it's ready. I've recently set up Apache so I can work with php and I have followed, pretty carefully, all the instructions to set up a virtual host so I can actually see what I'm doing to the local site.

If I go to localhost in my browser, I see the Wampserver page as I'd expect. When I click the link for the virtual host (I've set up 2 now, to see if I'd done it wrong the first time), my browser jumps to our externally hosted website.

I cannot understand how it is happening, because nowhere in any of the various.conf files did I put the url of that site.

I'm new to this - what have I missed? screenshot of Wampserver localhost homepage

After more searching I spotted that a couple of the questions with the opposite problem to mine (redirecting to a local site when it should be external) had references to the .htaccess file in the answers. Figuring the cause could be the same as mine, I've removed the .htaccess file from the local copy of my website and it's now all behaving properly.

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