Answer the question
In order to leave comments, you need to log in
How not to get into trouble when using a redirect in JavaScript when protecting a site from copying?
I'm experimenting with copy protection options for the site. I understand that this is a "fight against windmills" and, if desired, they will copy everything, but still. I would like to understand the consequences of using such a move in case of copying the site page by a housewife / soulless crooked parser + third-party services (search engines, their bots and services).
Imagine. JS embedded in the page:
// устанавливаем имя домена
var $url = "example.com";
// если установленный домен на совпадает с текущим, редиректим на наш домен
if ( $url !== location.host) { location.href = 'http://' + $url; }
// устанавливаем URL страницы
var $url = "http://example.com/page-x";
// если установленный ГКД на совпадает с текущим, редиректим на нужный URL
if ( $url !== location.href) { location.href = $url; }
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question