BLACK FRIDAY DEALS

Knowledge Base

Allows you to search a variety of questions and answers

Search

Search results

General Server Questions

You can do this via .htaccess either by adding the file to each root directory of the site, or adding the code to the specific container in the httpd.conf file. 

There are a few different ways to do this.

1. To replace the hotlinked image with a 'nohotlink.jpg' image, put the following into the .htaccess file:
 

Code:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]

2. To prevent linking from specific outside domains like myspace.com, youtube.com, etc..
 

Code:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]

To just show a 403 error, replace the last lines in the previous examples with
 

Code:

RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F]

See What Our Customers Say

Leave review
H

holidaypropertyrental.com

England, United Kingdom

I have a two small shared hosting packages and the price I pay I don't expect to receive very good s...

Read full review
K

kkodev

London, United Kingdom

After getting a dedicated server from AYK for almost 2 years, I couldn't be more happy. The prices...

Read full review
J

Jose E

ON, Canada

I very seldom contact support, but if I do, the response is always prompt and issues are always res...

Read full review
E

Ephi

QC, Canada

Great prices and service! Truly is painless, professional and polite (That's their slogan).

Read full review
ARIN Cisco Supermicro cPanel Intel Microsoft