How to prevent somebody's domain from pointing to my droplet?

Posted February 1, 2020 877 views
ApacheWordPressDigitalOceanUbuntu 18.04

Hi, developers

I have recently moved my site from shared hosting to the Digital ocean. And believe or not it was a tough step for me as I don’t have deep knowledge about the server configuration.

After two months, everything is going well so far, but recently, I have started to face a security issue.

Someone has pointed their domain to my IP. I.e is also accessible from I have got to know about the cause and it pretty much hurting my page ranking. My issue is something like this

Can anybody suggest how to deal with this?

PS: I can’t try this How to Rewrite URLs with mod_rewrite for Apache on Ubuntu 18.04

My server configuration:
Ubuntu 18.04


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


What I could suggest here is:

  • Create a Virtual Host for your website, here is a step by step guide on how to do that:

  • After that set your Default Virtual Host to deny all traffic. For example, you could use something like this:
<VirtualHost *:80>
    <Location />
    Order deny,allow
    Deny from all


That way if a domain name does not have a Virtual Host on your server, it would be routed to the default Virtual Host which would result in a 403 Forbidden error.

Hope that this helps! Let me know if you have any questions.

by Brennen Bearnes
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 16.04 server.