{"id":520,"date":"2013-01-25T19:41:45","date_gmt":"2013-01-25T19:41:45","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2013\/01\/25\/hotlink-protect-htaccess\/"},"modified":"2026-02-18T16:12:06","modified_gmt":"2026-02-18T21:12:06","slug":"prevent-image-hotlinking-htaccess","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/","title":{"rendered":"How to Prevent Image Hotlinking with .htaccess Rules"},"content":{"rendered":"\n<p>Hotlinking drains your server bandwidth when other websites embed your images directly. This guide shows you how to block hotlinked images using Apache .htaccess rewrite rules, protecting your hosting resources without affecting legitimate visitors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is Hotlinking?<\/h2>\n\n\n\n<p>Hotlinking happens when someone embeds your image on their website by pointing directly to your server URL rather than hosting the file themselves.<\/p>\n\n\n\n<p>For example, if another site uses this code:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #808080\">&lt;<\/span><span style=\"color: #569CD6\">img<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">src<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\">&quot;https:\/\/yoursite.com\/images\/photo.jpg&quot;<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #808080\">\/&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Your server delivers the image every time their page loads. Multiply that across dozens of sites and high-traffic pages, and you&#8217;ll see CPU spikes, bandwidth overages, and slower performance for your actual visitors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Hotlink Protection Matters<\/h2>\n\n\n\n<p>Hotlinking creates two problems:<\/p>\n\n\n\n<p><strong>Resource theft.<\/strong> Every hotlinked request consumes your server&#8217;s CPU, memory, and bandwidth allocation. On Shared Hosting plans, excessive hotlinking can trigger resource limit warnings or account throttling.<\/p>\n\n\n\n<p><strong>Content misuse.<\/strong> Your images appear on other websites without attribution or permission, often in contexts you didn&#8217;t authorize.<\/p>\n\n\n\n<p>Blocking hotlinks stops both issues while still allowing your images to load normally for your own site visitors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Block Hotlinking with .htaccess<\/h2>\n\n\n\n<p>The most reliable method for preventing hotlinking is adding <a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/mod\/mod_rewrite.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Apache mod_rewrite rules<\/a> to your <code>.htaccess<\/code> file. These rules run at the server level before PHP or WordPress even loads, making them efficient and universally compatible.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Basic Hotlink Protection<\/h3>\n\n\n\n<p>This code blocks direct access to common image formats from external domains:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">RewriteEngine<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #B392F0\">on<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteCond<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">%{HTTP_REFERER}<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">!^$<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteCond<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">%{HTTP_REFERER}<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">!^https:\/\/(www\\.)?yoursite\\.com\/.*$<\/span><span style=\"color: #E1E4E8\"> &#91;NC&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteRule<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">\\.(jpg|jpeg|gif|png|bmp|webp)$<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">-<\/span><span style=\"color: #E1E4E8\"> &#91;F&#93;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Replace <code>yoursite.com<\/code> with your actual domain.<\/p>\n\n\n\n<p><strong>How it works:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>RewriteEngine on<\/code> enables Apache&#8217;s rewrite module<\/li>\n\n\n\n<li><code>RewriteCond %{HTTP_REFERER} !^$<\/code> allows requests with no referrer (direct browser access)<\/li>\n\n\n\n<li><code>RewriteCond %{HTTP_REFERER} !^https:\/\/(www\\.)?yoursite\\.com\/.*$ [NC]<\/code> allows requests from your own domain<\/li>\n\n\n\n<li><code>RewriteRule \\.(jpg|jpeg|gif|png|bmp|webp)$ - [F]<\/code> returns a 403 Forbidden error for blocked image requests<\/li>\n<\/ul>\n\n\n\n<p>The <code>[NC]<\/code> flag makes the domain match case-insensitive. The <code>[F]<\/code> flag sends an HTTP 403 status code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Allow Multiple Domains<\/h3>\n\n\n\n<p>If you manage multiple sites or want to allow specific partner domains:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">RewriteEngine<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #B392F0\">on<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteCond<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">%{HTTP_REFERER}<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">!^$<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteCond<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">%{HTTP_REFERER}<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">!^https:\/\/(www\\.)?yoursite\\.com\/.*$<\/span><span style=\"color: #E1E4E8\"> &#91;NC&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteCond<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">%{HTTP_REFERER}<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">!^https:\/\/(www\\.)?partnerdomain\\.com\/.*$<\/span><span style=\"color: #E1E4E8\"> &#91;NC&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteCond<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">%{HTTP_REFERER}<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">!^https:\/\/(www\\.)?anotherdomain\\.net\/.*$<\/span><span style=\"color: #E1E4E8\"> &#91;NC&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteRule<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">\\.(jpg|jpeg|gif|png|bmp|webp)$<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">-<\/span><span style=\"color: #E1E4E8\"> &#91;F&#93;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Add one <code>RewriteCond<\/code> line for each domain you want to whitelist.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Redirect to a Warning Image<\/h3>\n\n\n\n<p>Instead of showing a broken image, redirect hotlinkers to a replacement image explaining the policy:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">RewriteEngine<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #B392F0\">on<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteCond<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">%{HTTP_REFERER}<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">!^$<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteCond<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">%{HTTP_REFERER}<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">!^https:\/\/(www\\.)?yoursite\\.com\/.*$<\/span><span style=\"color: #E1E4E8\"> &#91;NC&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteRule<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">\\.(jpg|jpeg|gif|png|bmp|webp)$<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">https:\/\/yoursite.com\/images\/hotlink-warning.png<\/span><span style=\"color: #E1E4E8\"> &#91;R,L&#93;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Create a simple <code>hotlink-warning.png<\/code> image with text like &#8220;This image is hosted at yoursite.com&#8221; and upload it to your <code>\/images\/<\/code> directory. The <code>[R,L]<\/code> flags trigger a redirect and stop processing further rules.<\/p>\n\n\n\n<p>This approach maintains visual consistency on the offending site while making it clear the image belongs to you.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Redirect to a Custom Error Page<\/h3>\n\n\n\n<p>For non-image hotlinking attempts (like direct video or PDF access), send users to an HTML page:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">RewriteEngine<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #B392F0\">on<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteCond<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">%{HTTP_REFERER}<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">!^$<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteCond<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">%{HTTP_REFERER}<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">!^https:\/\/(www\\.)?yoursite\\.com\/.*$<\/span><span style=\"color: #E1E4E8\"> &#91;NC&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">RewriteRule<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #DBEDFF\">\\.(jpg|jpeg|gif|png|bmp|webp|mp4|pdf)$<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">https:\/\/yoursite.com\/restricted.html<\/span><span style=\"color: #E1E4E8\"> &#91;R,L&#93;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Where to Add .htaccess Rules<\/h2>\n\n\n\n<p>Your <code>.htaccess<\/code> file lives in your website&#8217;s root directory, typically <code>public_html<\/code> or <code>www<\/code>.<\/p>\n\n\n\n<p><strong>To edit via cPanel File Manager:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list article_list\">\n<li><a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\">Log into cPanel.<\/a><\/li>\n\n\n\n<li>Open <strong>File Manager<\/strong> under the Files section<\/li>\n\n\n\n<li>Navigate to your site&#8217;s root directory<\/li>\n\n\n\n<li>Right-click <code>.htaccess<\/code> and select <strong>Edit<\/strong><\/li>\n\n\n\n<li>Add the rewrite rules at the top of the file, before any existing WordPress or application rules<\/li>\n\n\n\n<li>Save changes<\/li>\n<\/ol>\n\n\n\n<p><strong>To edit via SSH:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">nano<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">\/home\/username\/public_html\/.htaccess<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Add the rules, then save with <code>Ctrl+O<\/code> and exit with <code>Ctrl+X<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Directory-Specific Protection<\/h3>\n\n\n\n<p>To protect only certain directories (like <code>\/wp-content\/uploads\/<\/code> for WordPress sites), create or edit the <code>.htaccess<\/code> file in that specific folder:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">nano<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">\/home\/username\/public_html\/wp-content\/uploads\/.htaccess<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>This narrows protection to uploaded media files without affecting theme images or other assets.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Testing Your Configuration<\/h2>\n\n\n\n<p>After adding rules, verify they work:<\/p>\n\n\n\n<ol class=\"wp-block-list article_list\">\n<li><strong>Test from your own site.<\/strong> Images should load normally when viewing your pages<\/li>\n\n\n\n<li><strong>Test direct browser access.<\/strong> Navigate to an image URL directly (like <code>https:\/\/yoursite.com\/images\/photo.jpg<\/code>). This should still work because the referrer is empty<\/li>\n\n\n\n<li><strong>Test external embedding.<\/strong> Create a test HTML file on another domain with an <code>&lt;img&gt;<\/code> tag pointing to your image. The image should either break (with 403 rules) or show your replacement image (with redirect rules)<\/li>\n<\/ol>\n\n\n\n<p>Check your <a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-view-your-access-and-error-logs\/\">Apache error logs<\/a> for any issues. Blocked requests appear with <code>403<\/code> status codes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Performance Impact<\/h2>\n\n\n\n<p>Hotlink protection rules execute before PHP, so they add minimal overhead. On <a href=\"https:\/\/www.inmotionhosting.com\/wordpress-hosting\">WordPress Hosting<\/a> or VPS plans with thousands of images, you&#8217;ll actually improve performance by reducing unauthorized bandwidth consumption.<\/p>\n\n\n\n<p>If you notice any slowdown, confirm <code>mod_rewrite<\/code> is enabled. On InMotion VPS and Dedicated Servers, this module loads by default. On other hosting environments, contact Support if rewrites aren&#8217;t processing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When to Use Hotlink Protection<\/h2>\n\n\n\n<p>Implement these rules if:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Your bandwidth usage suddenly spikes without traffic increases<\/li>\n\n\n\n<li>Server monitoring shows high I\/O for the <code>\/images\/<\/code> or <code>\/uploads\/<\/code> directory<\/li>\n\n\n\n<li>You discover your images embedded on scraper sites or content farms<\/li>\n\n\n\n<li>You&#8217;re approaching bandwidth limits on Shared Hosting<\/li>\n<\/ul>\n\n\n\n<p>Skip hotlink protection if:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Your images are meant to be shared (infographics, charts, public resources)<\/li>\n\n\n\n<li>You use a CDN that handles delivery separately (the CDN manages this at the edge)<\/li>\n\n\n\n<li>Your site receives minimal traffic and bandwidth isn&#8217;t a concern<\/li>\n<\/ul>\n\n\n\n<p>For high-traffic sites or ecommerce stores where image delivery affects performance, hotlink protection is a straightforward way to reclaim server resources without impacting your actual customers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hotlinking drains your server bandwidth when other websites embed your images directly. This guide shows you how to block hotlinked images using Apache .htaccess rewrite rules, protecting your hosting resources without affecting legitimate visitors. What is Hotlinking? Hotlinking happens when someone embeds your image on their website by pointing directly to your server URL rather<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/\"> Read More ><\/a><\/p>\n","protected":false},"author":56983,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4288],"tags":[],"class_list":["post-520","post","type-post","status-publish","format-standard","hentry","category-website"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Prevent Image Hotlinking with .htaccess Rules | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Protect your server bandwidth by blocking hotlinked images using .htaccess rewrite rules. Step-by-step examples for Apache servers.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Prevent Image Hotlinking with .htaccess Rules | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Protect your server bandwidth by blocking hotlinked images using .htaccess rewrite rules. Step-by-step examples for Apache servers.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2013-01-25T19:41:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-18T21:12:06+00:00\" \/>\n<meta name=\"author\" content=\"Carrie Smaha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@carriesmaha\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Carrie Smaha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/\"},\"author\":{\"name\":\"Carrie Smaha\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8\"},\"headline\":\"How to Prevent Image Hotlinking with .htaccess Rules\",\"datePublished\":\"2013-01-25T19:41:45+00:00\",\"dateModified\":\"2026-02-18T21:12:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/\"},\"wordCount\":775,\"commentCount\":8,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/\",\"name\":\"How to Prevent Image Hotlinking with .htaccess Rules | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2013-01-25T19:41:45+00:00\",\"dateModified\":\"2026-02-18T21:12:06+00:00\",\"description\":\"Protect your server bandwidth by blocking hotlinked images using .htaccess rewrite rules. Step-by-step examples for Apache servers.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Prevent Image Hotlinking with .htaccess Rules\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8\",\"name\":\"Carrie Smaha\",\"description\":\"Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/carriesmaha\/\",\"https:\/\/x.com\/carriesmaha\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/carries\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Prevent Image Hotlinking with .htaccess Rules | InMotion Hosting","description":"Protect your server bandwidth by blocking hotlinked images using .htaccess rewrite rules. Step-by-step examples for Apache servers.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/","og_locale":"en_US","og_type":"article","og_title":"How to Prevent Image Hotlinking with .htaccess Rules | InMotion Hosting","og_description":"Protect your server bandwidth by blocking hotlinked images using .htaccess rewrite rules. Step-by-step examples for Apache servers.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2013-01-25T19:41:45+00:00","article_modified_time":"2026-02-18T21:12:06+00:00","author":"Carrie Smaha","twitter_card":"summary_large_image","twitter_creator":"@carriesmaha","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Carrie Smaha","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/"},"author":{"name":"Carrie Smaha","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8"},"headline":"How to Prevent Image Hotlinking with .htaccess Rules","datePublished":"2013-01-25T19:41:45+00:00","dateModified":"2026-02-18T21:12:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/"},"wordCount":775,"commentCount":8,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/","name":"How to Prevent Image Hotlinking with .htaccess Rules | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2013-01-25T19:41:45+00:00","dateModified":"2026-02-18T21:12:06+00:00","description":"Protect your server bandwidth by blocking hotlinked images using .htaccess rewrite rules. Step-by-step examples for Apache servers.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-image-hotlinking-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Prevent Image Hotlinking with .htaccess Rules"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8","name":"Carrie Smaha","description":"Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth.","sameAs":["https:\/\/www.linkedin.com\/in\/carriesmaha\/","https:\/\/x.com\/carriesmaha"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/carries\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4288,"name":"Website","slug":"website","link":"https:\/\/www.inmotionhosting.com\/support\/website\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/56983"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=520"}],"version-history":[{"count":9,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/520\/revisions"}],"predecessor-version":[{"id":131587,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/520\/revisions\/131587"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}