Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

I am hosting my own html file as example.com in apache webserver, but example.com shows other page.

shivajikobardan

Legendary Coder
I am doing IP based virtual web hosting.

This is the edited part of configuration file-:

Code:
Listen 80


<VirtualHost *:80>
    DocumentRoot "C:\Apache24\htdocs\eg1"
    ServerName www.example.com

    # Other directives here
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:\Apache24\htdocs\eg2"
    ServerName www.example.org

    # Other directives here
</VirtualHost>

eg1 and eg2 are the folders where the respective html files exist.
I genuinely don't understand why is this happening. server is showing no problems. Please help
 
Are you actually using the domain example.com or another domain that you don't want to show?
 
Do you own this domains? Because you can't just host your own website on any random domain if you don't own it.
 

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom