Your hosting can make or break your site. Choosing the right host will undoubtedly determine your fate. Here you\'ll learn how it\' done.  Home Site Maintenance Hosting Services Introduction to .htaccess
Your Ad Here

Introduction to .htaccess

Browse Pages: << < 5  6  7  8  9  > >>

Image from Hosting Services: Hotlink Protection

Bandwidth theft or "hotlinking" is direct linking to a website's files (images, video, etc.). An example would be displaying a JPEG image you found on someone else's web page so it will appear on your own site, journal, weblog, forum posting, etc.

Bandwidth refers to the amount of data transferred from a website to a user's computer. When you view a webpage, you are using that site's data transfer to display the files. Since web hosts charge based on the amount of data transferred, bandwidth is an issue. If a site is over it's monthly bandwidth, it's billed for the extra data or taken offline until the owner of the site upgrades the account.

By preventing hotlinking on your site, other sites will not be able to link to your images. If you don't prevent this and come across a site that is linking to your images, you can do a "switcheroo". (Change the image that they linked to an offensive image or one that lets them know they are hotlinking.)

To enable hotlink protection on your site, open up your .htaccess file and add the following to the next available line. (Please refer to the Introduction to .htaccess files tutorial to find out how to use and create .htaccess files.)

RewriteEngine on RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com/.*$ [NC]
RewriteRule .(gif|jpg)$ - [F]

If you would like to enable hotlink protection on specific domains only, use the following code. (You will need to add each domain.)

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www.)?othersite.net/ [NC,OR
RewriteCond %{HTTP_REFERER} ^http://(www.)?othersite.com/ [NC
RewriteRule .(jpe?g|gif|bmp|png)$ images/nohotlink.jpg [L]

Finally save the .htaccess and upload it to your server; most likely in the root directory. Remember that .htaccess files will apply in all subdirectories below it.



Author's URL: Depiction.net
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
Browse Pages: << < 5  6  7  8  9  > >>
print this page subscribe to newsletter subscribe to rss

Read about the most important web services: web promotion, domain registration and website hosting. All web developers need this website maintenance stuff. More Site Maintenance: Most Popular Materials | Fresh Materials | Website Templates

Add comments to "Introduction to .htaccess"

Only registered users can write comment

No comments yet...