PHP is open source scripting language. It\'s widely used to develop web applications.  Home Web Programming PHP No Direct Linking
Your Ad Here

No Direct Linking


If you want to prevent those awful direct linkers, use this tutorial. Open up your notepad (start>>programs>>accessories>>notepad) or another text editor, and copy the code below to it. Name this file .htaccess and make sure it doesn't have an extension on the end, like .txt. If it is named .htaccess.txt, rename it  .htaccess. Save it and upload it to your main directory. Or, you can upload it as .htaccess.txt, and rename it when it's on your server.  If you already have a .htaccess file in your directory, because you have an IP block or something, just put the code beneath whatever you already have.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://WWWW.YOUR-SITE.COM/.*$ [NC]
RewriteRule .(gif|jpg)$ http://URLOFIMAGE.jpg [R,L]

.htaccess
.htaccess example

Replace http://WWWW.YOUR-SITE.COM/ with the url of your site. Replace http://URLOFIMAGE.jpg with the url of the image you want to show up instead of your own when people direct link.



Author's URL: Lindsay Coome
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
print this page subscribe to newsletter subscribe to rss

Web programming � everything from the basics of visual design and architecture to the specifics of applications, graphics, and scripting. More Web Programming: Most Popular Materials | Fresh Materials | More PHP Tutorials at LearnPHP.org

Add comments to "No Direct Linking"

Only registered users can write comment

No comments yet...