![]() |
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 |
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] |
Doesn't work :(
|
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] |
Doesn't work too :(
|
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 ;) |
If your /hotlinkable/ directory is below the directory that you have protected, make sure you put
RewriteEngine off in your .htaccess |
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] :( |
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 |
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 |
ok thanks guys, now is ok :)
|
All times are GMT -4. The time now is 12:06 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc