Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2005-06-22, 01:13 PM   #1
Roni20
Heh Heh Heh! Lisa! Vampires are make believe, just like elves and gremlins and eskimos!
 
Roni20's Avatar
 
Join Date: Dec 2004
Posts: 79
Remove 1 image from htaccess protection

Hi

I want to remove 1 image from some folder from htaccess protection, how to do this?

regards
roni
Roni20 is offline   Reply With Quote
Old 2005-06-22, 04:15 PM   #2
Leon
You can now put whatever you want in this space :)
 
Leon's Avatar
 
Join Date: Jun 2004
Location: Israel
Posts: 527
Send a message via ICQ to Leon
well for example if you using something like:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yoursite.com.*$ [NC]
RewriteRule ^.+\.(jpg|jpeg|png|gif)$ - [NC,F,L]

i belive all you will need to is to add this:
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yoursite.com/images/mypic.gif.*$ [NC]
__________________
Submit your Sites to my LL's:
Only Best Sex | Rex Porn
Grant Domains
Leon is offline   Reply With Quote
Old 2005-06-22, 05:33 PM   #3
Roni20
Heh Heh Heh! Lisa! Vampires are make believe, just like elves and gremlins and eskimos!
 
Roni20's Avatar
 
Join Date: Dec 2004
Posts: 79
Doesn't work
Roni20 is offline   Reply With Quote
Old 2005-06-22, 05:37 PM   #4
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
RewriteEngine on
RewriteRule ^image_to_allow_hotlinking.jpg$ - [L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yoursite.com.*$ [NC]
RewriteRule (jpg|jpeg|png|gif)$ - [F,L]
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-06-23, 02:20 AM   #5
Roni20
Heh Heh Heh! Lisa! Vampires are make believe, just like elves and gremlins and eskimos!
 
Roni20's Avatar
 
Join Date: Dec 2004
Posts: 79
Doesn't work too
Roni20 is offline   Reply With Quote
Old 2005-06-23, 02:48 AM   #6
Leon
You can now put whatever you want in this space :)
 
Leon's Avatar
 
Join Date: Jun 2004
Location: Israel
Posts: 527
Send a message via ICQ to Leon
hmm intresting , what you can do is to put the .htaccess directly in /images/ folder and the image you dont wont be protected to put outside of /images/ folder
that will defenetly work
__________________
Submit your Sites to my LL's:
Only Best Sex | Rex Porn
Grant Domains
Leon is offline   Reply With Quote
Old 2005-06-23, 03:10 AM   #7
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
If your /hotlinkable/ directory is below the directory that you have protected, make sure you put

RewriteEngine off


in your .htaccess
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-06-23, 04:53 AM   #8
Roni20
Heh Heh Heh! Lisa! Vampires are make believe, just like elves and gremlins and eskimos!
 
Roni20's Avatar
 
Join Date: Dec 2004
Posts: 79
If i have :

RewriteEngine on
RewriteRule ^domain.com/dir/dir/dir/image.jpg$ - [L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com.*$ [NC]
RewriteRule (jpg|jpeg|png|gif)$ - [F,L]

it doesn't work, all images are protected

---------
if:

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com.*$ [NC]
RewriteRule (jpg|jpeg|png|gif)$ - [F,L]

RewriteEngine off
RewriteRule ^domain.com/dir/dir/dir/image.jpg$ - [L]

than all images are able to hotlink the same with

RewriteEngine off

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com.*$ [NC]
RewriteRule (jpg|jpeg|png|gif)$ - [F,L]

RewriteRule ^domain.com/dir/dir/dir/image.jpg$ - [L]

Roni20 is offline   Reply With Quote
Old 2005-06-23, 12:55 PM   #9
Anothers
If something goes wrong at the plant, blame the guy who can't speak English
 
Join Date: Jan 2004
Location: Poland
Posts: 30
Quote:
Originally Posted by Roni20
If i have :

RewriteEngine on
RewriteRule ^domain.com/dir/dir/dir/image.jpg$ - [L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com.*$ [NC]
RewriteRule (jpg|jpeg|png|gif)$ - [F,L]
hmm

let's suppose this image is
http://www.domain.com/images/image.jpg

then this should work

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com.*$ [NC]
RewriteCond %{REQUEST_URI} !^/images/image.jpg$
RewriteRule (jpg|jpeg|png|gif)$ - [F,L]

Edited: RewriteEngine off - turns off all rewrite engine so anything like RewriteCond or RewriteRule doesnt work when is below RewriteEngine off
Anothers is offline   Reply With Quote
Old 2005-06-23, 02:03 PM   #10
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
If http://www.domain.com/ is protected
If you want to serve http://www.domain.com/image.jpg and allow hotlinking

RewriteEngine on
RewriteRule ^image.jpg$ - [L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com.*$ [NC]
RewriteRule (jpg|jpeg|png|gif)$ - [F,L]

If http://www.domain.com/ is protected
If you want to serve anything in http://www.domain.com/image/ and allow hotlinking

put this in your main .htaccess in the root of http://domain.com/
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com.*$ [NC]
RewriteRule (jpg|jpeg|png|gif)$ - [F,L]

and in the image directory put the following in .htaccess
RewriteEngine off
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-06-23, 03:27 PM   #11
Roni20
Heh Heh Heh! Lisa! Vampires are make believe, just like elves and gremlins and eskimos!
 
Roni20's Avatar
 
Join Date: Dec 2004
Posts: 79
ok thanks guys, now is ok
Roni20 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:13 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc