Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
90 views
in Technique[技术] by (71.8m points)

php - Virtual Host directs me to Xampp dashboard

I am trying to run my website on different devices.

I have this in my httpd-vhosts.confiq

NameVirtualHost *:80

<VirtualHost VirtualHost 127.0.0.1:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/xampp/htdocs/"
    ServerName mywebsite.com
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

I have uncommented out the hash's that were in the file before changing them.

in my hosts files:

192.168.56.1           mywebsite.com

My website folder is like so:

Mywebsite
    - Home
        -about 
        -blog
        -profile
    - index.php
    - login
        -login.php
    - connections
        -connections.php

so these are the folders with some of the files inside.

Now when i restart apache and type the following:

http://mywebsite.com

it directs me to http://mywebsite.com/dashboard which is just a xampp webpage.

Why does this occur?

Thanks.

question from:https://stackoverflow.com/questions/65947527/virtual-host-directs-me-to-xampp-dashboard

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Without the full configution I can only guess but I suggest you to start changing

<VirtualHost VirtualHost 127.0.0.1:80>

to

<VirtualHost *:80>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...