|
2005-06-22, 01:13 PM | #1 |
Heh Heh Heh! Lisa! Vampires are make believe, just like elves and gremlins and eskimos!
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 |
2005-06-22, 04:15 PM | #2 |
You can now put whatever you want in this space :)
|
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] |
2005-06-22, 05:33 PM | #3 |
Heh Heh Heh! Lisa! Vampires are make believe, just like elves and gremlins and eskimos!
Join Date: Dec 2004
Posts: 79
|
Doesn't work
|
2005-06-22, 05:37 PM | #4 |
a.k.a. Sparky
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 |
2005-06-23, 02:20 AM | #5 |
Heh Heh Heh! Lisa! Vampires are make believe, just like elves and gremlins and eskimos!
Join Date: Dec 2004
Posts: 79
|
Doesn't work too
|
2005-06-23, 02:48 AM | #6 |
You can now put whatever you want in this space :)
|
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 |
2005-06-23, 03:10 AM | #7 |
a.k.a. Sparky
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 |
2005-06-23, 04:53 AM | #8 |
Heh Heh Heh! Lisa! Vampires are make believe, just like elves and gremlins and eskimos!
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] |
2005-06-23, 12:55 PM | #9 | |
If something goes wrong at the plant, blame the guy who can't speak English
Join Date: Jan 2004
Location: Poland
Posts: 30
|
Quote:
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 |
|
2005-06-23, 02:03 PM | #10 |
a.k.a. Sparky
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 |
2005-06-23, 03:27 PM | #11 |
Heh Heh Heh! Lisa! Vampires are make believe, just like elves and gremlins and eskimos!
Join Date: Dec 2004
Posts: 79
|
ok thanks guys, now is ok
|
|
|