Animeboards.com Forums

Animeboards.com Forums (http://animeboards.com/index.php)
-   HTML, PHP, MySQL, Graphics, Coding (http://animeboards.com/forumdisplay.php?f=88)
-   -   How to prevent Direct Linking? (http://animeboards.com/showthread.php?t=57884)

Squire212 04-03-2005 02:42 AM

How to prevent Direct Linking?
 
The title speaks for itself. I was just wondering how you can make it so that people can not direct link to your site for files.

I don't want to disablet he entire direct linking because that means they can't direct link to my site's buttom.

Any help is appreciated.

raynebc 04-03-2005 03:47 AM

It would probably depend on how your site is being hosted. If it's a free service like Angelfire, they usually don't allow direct linking. But if that were the case you wouldn't be asking. Since I don't know, all I can suggest is for you to provide some basic server information for your page so somebody can get you an answer faster.

Squire212 04-03-2005 04:56 AM

I'm hosted under StarLogic. You pay monthly. Here's a link to the hosting site. Starlogic.com

xfracture 05-03-2005 01:54 AM

you can prevent direct linking using an .htaccess file (if your host allows it)

if you want to block by file extention, you would add the following:
Code:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourwebsite.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ - [F,NC]

if you want to block a certain file you add the following to it:
Code:

<Files yourfilehere>
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourwebsite.com(/)?.*$ [NC]
RewriteRule yourfile [F]
</Files>



All times are GMT -4. The time now is 02:25 AM.

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2018, vBulletin Solutions, Inc.