{"id":5408,"date":"2025-06-13T07:30:06","date_gmt":"2025-06-13T07:30:06","guid":{"rendered":"https:\/\/the-online.com\/hosting\/?p=5408"},"modified":"2025-06-13T07:31:50","modified_gmt":"2025-06-13T07:31:50","slug":"how-to-prevent-website-from-hotlinking-on-apache-server","status":"publish","type":"post","link":"https:\/\/the-online.com\/hosting\/how-to-prevent-website-from-hotlinking-on-apache-server\/","title":{"rendered":"How To Prevent Website From Hotlinking on Apache Server"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Guide to prevent hotlinking images on Apache server <\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Hotlinking<\/strong> is the process of stealing someone&#8217;s website bandwidth by directly adding assets from one website to another. These assets can be images, videos, or audio. The other websites embed your images, videos and audio by copying the HTML code. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your website is hosted on an <strong>Apache server<\/strong> then you can follow these simple steps to enable hotlink protection on an Apache server is easier than you might think. <\/p><div class='code-block code-block-9' style='margin: 8px auto 8px 0; text-align: left; display: block; clear: both;'>\n<!-- OnlHeaderResponsive -->\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-5339207343588395\"\n     data-ad-slot=\"9406207027\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<script>\n(adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/div>\n\n\n\n\n<p class=\"wp-block-paragraph\">Open the .htaccess file in your root directory of the Apache server and add the following code: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RewriteEngine on\n\nRewriteCond %{HTTP_REFERER} !^$\n\nRewriteCond %{HTTP_REFERER} !^http(s)?:\/\/(www\\.)?yourdomain.com &#91;NC]\n\nRewriteCond %{HTTP_REFERER} !^http(s)?:\/\/(www\\.)?google.com &#91;NC]\n\nRewriteCond %{HTTP_REFERER} !^http(s)?:\/\/(www\\.)?bing.com &#91;NC]\n\nRewriteCond %{HTTP_REFERER} !^http(s)?:\/\/(www\\.)?yahoo.com &#91;NC]\n\nRewriteRule \\.(jpg|jpeg|png|gif|svg)$ https:\/\/dropbox.com\/hotlink-placeholder.jpg &#91;NC,R,L]<\/code><\/pre>\n<!-- CONTENT END 1 -->\n","protected":false},"excerpt":{"rendered":"<p>Guide to prevent hotlinking images on Apache server Hotlinking is the process of stealing someone&#8217;s website bandwidth by directly adding assets from one website to&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kb_optimizer_status":0,"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[16],"tags":[382,384,318,317],"class_list":["post-5408","post","type-post","status-publish","format-standard","hentry","category-forum","tag-apache","tag-codeing","tag-guide","tag-help"],"_links":{"self":[{"href":"https:\/\/the-online.com\/hosting\/wp-json\/wp\/v2\/posts\/5408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/the-online.com\/hosting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/the-online.com\/hosting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/the-online.com\/hosting\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/the-online.com\/hosting\/wp-json\/wp\/v2\/comments?post=5408"}],"version-history":[{"count":0,"href":"https:\/\/the-online.com\/hosting\/wp-json\/wp\/v2\/posts\/5408\/revisions"}],"wp:attachment":[{"href":"https:\/\/the-online.com\/hosting\/wp-json\/wp\/v2\/media?parent=5408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/the-online.com\/hosting\/wp-json\/wp\/v2\/categories?post=5408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/the-online.com\/hosting\/wp-json\/wp\/v2\/tags?post=5408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}