M
M
Maxla932016-12-09 14:34:57
htaccess
Maxla93, 2016-12-09 14:34:57

How to prevent a site from opening on all domains except site.com?

Set up default VirtualHost in apache to your domain.
> But, unknown people created a domain and tied it to the ip of my server and my site began to appear on their domain.
How can I prevent the site from opening on all domains except mine?

<VirtualHost 123.123.123.123:80>
  ServerName www.site.com
    ServerAlias site.com

  ServerAdmin [email protected]
  DocumentRoot /var/www
  
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Evseev, 2016-12-10
@IlyaEvseev

More or less like this:

RewriteEngine On
RewriteCond %{HTTP_HOST}  !^www\.site\.com$ [nocase]
RewriteRule ^(.*)$        http://www.site.com$1 [last,redirect=301]

But if they change the name of the site when proxying on the fly, then this method will not help.
You need to look at what IP they are accessing from and block it.
But if they access through anonymous proxies, then this method will not help either.
It also makes sense to see which User-Agent and Referer are used in their requests.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question