Langsung ke konten utama

Mencegah Hotlinking Melalui htaccess Server Apache

Hebbie Ilma Adzim, S.ST

Berikut kode yang dipasang pada htaccess Server Apache untuk mencegah hotlinking dan telah dicoba di Server Apache 2 XAMPP Windows 10 64 bit.

<IfModule mod_rewrite.c>
    
# Cegah Hotlinking
RewriteCond %{HTTP_HOST}@@%{HTTP_REFERER} !^([^@]*)@@https?://\1/.*
RewriteRule \.(jpg|jpeg|png|mp4|webp|webm|gif)$ – [NC,F,L]

</IfModule>