How to prevent laravel websites being copied using HTTracks

97 Views Asked by At

How to prevent laravel websites being copied using HTTracks or other software, Thank you

1

There are 1 best solutions below

0
brifiction On

If using Apache, then .htaccess file might help, with a bunch of RewriteCond rules by HTTP user agent.

Or, Nginx similar approach like below:

if ($http_user_agent ~* "^xxx$") {
   rewrite ^/(.*)$ http://toobad.dev/$1 permanent;
}

Or attempting to block but at Laravel app level, see https://laravel.com/api/9.x/Illuminate/Http/Request.html#method_userAgent.

echo $request->userAgent();

I haven't mess around with latest Laravel 9.x yet, but shared above from their API library - only a pseudocode above.

In short, identifying the HTTP user agent may be the way to catch these things. If not, any signature identifiers from HTTracks may help, that's visible in the Headers, to create 'flags' for you to block or execute conditional 'deflection'.

Hope above helps.