|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi everyone! I have a script that displays images stored in a database. To prevent leeching I used PHP and HTTP_REFERER but we all know this isn't an exact science.
I want to prevent the script (image_data.inc.php) from being used from another domain. Isn't there something I can do in the http.conf file to make sure the script is only ran from mydomain.com? Thanks a million! Steve |
|
#2
|
|||
|
|||
|
It's been discussed thousands of times so please search with the keywords like: hot linking, image protect or so.
|
|
#3
|
|||
|
|||
|
Okay didn't know about the other terms. It still uses HTTP_REFERER... I guess this has the same problems as my PHP script. Well it isn't really a problem... Thanks!
RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC] RewriteRule \.(gif|jpg|png|css|js)$ - [F] |
|
#4
|
|||
|
|||
|
If you have such PHP script just specify the HTTP_REFERER explicitly in the RewriteCond. Your first condition is not even needed in that case.
Your RewriteRule also doesn't really match anything. That should be absolute URI so please fix that. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Preventing leeching? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|