Mobile app version of vmapp.org
Login or Join
Candy875

: Unwanted redirect from a domain to my site An external person from my client company registered a domain and redirected to my client URL. For instance, if you type unwanteddomain.com it redirects

@Candy875

Posted in: #Domains #Htaccess #Redirects

An external person from my client company registered a domain and redirected to my client URL.

For instance, if you type unwanteddomain.com it redirects to myclientdomain.com.

Is there any way to block or redirect (for second time) to nowhere the unwanteddomain.com via cPanel or any rewrite rules on .htaccess?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Candy875

2 Comments

Sorted by latest first Latest Oldest Best

 

@Sue5673885

Finally resolved using these rewrite rules:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.unwanteddomain.com$ [NC]
RewriteRule .* whateverPlaceYouWantToSend.com [R,L]


HTTP_REFERER did not work so I used HTTP_HOST.

10% popularity Vote Up Vote Down


 

@Dunderdale272

The way I would do this is block all requests which are coming from unwantedcomain.com by checking for HTTP_REFERER


Block traffic from a single domain:

RewriteEngine on
RewriteCond %{HTTP_REFERER} unwateddomain.com [NC]
RewriteRule .* - [F]

Block traffic from multiple domains:

RewriteEngine on
RewriteCond %{HTTP_REFERER} unwanteddomain.com [NC,OR]
RewriteCond %{HTTP_REFERER} anotherdomain.com
RewriteRule .* - [F]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme