infinity
Verified Account
Newbie
Karma: +0/-0
Offline
Posts: 10
Blog entries
( 0)
|
 |
« on: November 27, 2005, 08:07:40 PM » |
|
Hiya
I seem to have run into a small problem but that could be me just so I'm not sure.
Anyway I have a htaccess file in my root directory to stop direct linking however it is not working.
I also have some in folders to prevent viewing the index and that is working.
So my problem is how do I get the htaccess to work for the direct linking???
I don't want to open my site until I can get it to work
Thanks for any help.
|
|
|
Logged
|
|
|
|
webzone (archived)
Official Technical Support
Verified Account
Hero Member
Karma: +0/-0
Offline
Posts: 508
Archived Account
Blog entries
( 0)
|
 |
« Reply #1 on: November 27, 2005, 08:14:46 PM » |
|
not sure what you mean by direct linking... if you mean hotlinking (another site using your image inside their page), it is getting harder to block.
many software and devices are now removing or garbling the referer header which is used to allow or block hotlinking. i must also say that blocking hotlinking may cause problems with google image search.
i know this info won't help you a lot, but it may help you reconsider this "protection" which is generally useless.
|
|
|
Logged
|
|
|
|
FreePgs.com Forum
|
 |
« Reply #1 on: November 27, 2005, 08:14:46 PM » |
|
|
|
|
Logged
|
|
|
|
infinity
Verified Account
Newbie
Karma: +0/-0
Offline
Posts: 10
Blog entries
( 0)
|
 |
« Reply #2 on: November 27, 2005, 08:20:22 PM » |
|
Hiya
Sorry I did mean hotlinking. it worked before on the other freepgs system not sure why it's not working now.
|
|
|
Logged
|
|
|
|
ghost
Toasty Warrior
Non-Verified Account
Full Member
 
Karma: +0/-0
Offline
Posts: 148
I'm thirsty.
Blog entries
( 0)
|
 |
« Reply #3 on: November 27, 2005, 10:49:47 PM » |
|
It possible that you were on Plesk lasttime? Maybe thats why its not working this time...
|
|
|
Logged
|
- Ghost -
|
|
|
FreePgs.com Forum
|
 |
« Reply #3 on: November 27, 2005, 10:49:47 PM » |
|
|
|
|
Logged
|
|
|
|
infinity
Verified Account
Newbie
Karma: +0/-0
Offline
Posts: 10
Blog entries
( 0)
|
 |
« Reply #4 on: November 28, 2005, 03:22:37 AM » |
|
Ive never been on the plesk system. Im talking about the sites hosted on freepgs.com
Htaccess to stop hotlinking worked on the system before the fire but now its not. I thought it was my cache so I cleaned it out but still no good, I even uploaded a image that has not been viewed by my browser and still it does not work it was able to be hotlinked.
Thanks
|
|
|
Logged
|
|
|
|
Ben
FreePgs Tech Support
Technical Support
Sr. Member
   
Karma: +12/-0
Offline
Posts: 344
Blog entries
( 0)
|
 |
« Reply #5 on: November 28, 2005, 12:11:10 PM » |
|
Could you post the .htaccess file (at least the part you're using for the hotlinking...)
|
|
|
Logged
|
|
|
|
infinity
Verified Account
Newbie
Karma: +0/-0
Offline
Posts: 10
Blog entries
( 0)
|
 |
« Reply #6 on: November 28, 2005, 02:51:11 PM » |
|
RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?freepgs.com/pinkness/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?freepgs.com/pinkness.*$ [NC] RewriteRule \.(gif|jpg)$ - [F]
|
|
|
Logged
|
|
|
|
Ben
FreePgs Tech Support
Technical Support
Sr. Member
   
Karma: +12/-0
Offline
Posts: 344
Blog entries
( 0)
|
 |
« Reply #7 on: November 28, 2005, 05:23:30 PM » |
|
Not sure if this is the only error, but I fixed one. RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?freepgs.com/pinkness/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?freepgs.com/pinkness.*$ [NC] RewriteRule \.(gif|jpg)$ - [F,L]
|
|
|
Logged
|
|
|
|
infinity
Verified Account
Newbie
Karma: +0/-0
Offline
Posts: 10
Blog entries
( 0)
|
 |
« Reply #8 on: November 28, 2005, 05:42:46 PM » |
|
Hi
I tried it with your fix but still the same no change. I honestly donnt know whats up with it. Does the server allow mod rewrite?
Thanks
|
|
|
Logged
|
|
|
|
webzone (archived)
Official Technical Support
Verified Account
Hero Member
Karma: +0/-0
Offline
Posts: 508
Archived Account
Blog entries
( 0)
|
 |
« Reply #9 on: November 28, 2005, 09:37:28 PM » |
|
mod_rewrite is enabled. Changes I made in the code below : - Added an [OR] between two RewriteCond - Simplify your rewrite code a bit so it will run faster - Added PNG as a protected extension Try this :
RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ [OR] RewriteCond %{HTTP_REFERER} !^http://(www\.)?freepgs.com/pinkness(/.*)?$ [NC] RewriteRule \.(gif|jpg|png)$ / [F,L]Both examples were originally provided, but the first one seems to be buggy. The second one works : RewriteEngine on RewriteCond %{HTTP_REFERER} !^(http://(www\.)?freepgs.com/pinkness(/.*)?)?$ [NC] RewriteRule \.(gif|jpg|png)$ / [F,L]
|
|
« Last Edit: December 01, 2005, 07:42:44 PM by webzone »
|
Logged
|
|
|
|
infinity
Verified Account
Newbie
Karma: +0/-0
Offline
Posts: 10
Blog entries
( 0)
|
 |
« Reply #10 on: November 28, 2005, 10:49:19 PM » |
|
Hiya webzone
You are FANTASTIC!!!!! It works like a charm, thank you.
|
|
|
Logged
|
|
|
|
webzone (archived)
Official Technical Support
Verified Account
Hero Member
Karma: +0/-0
Offline
Posts: 508
Archived Account
Blog entries
( 0)
|
 |
« Reply #11 on: November 28, 2005, 10:51:26 PM » |
|
you're welcome
|
|
|
Logged
|
|
|
|
infinity
Verified Account
Newbie
Karma: +0/-0
Offline
Posts: 10
Blog entries
( 0)
|
 |
« Reply #12 on: November 29, 2005, 10:57:27 PM » |
|
Hiya
Although this is working when I tested it yesterday I never checked my site until now. I had to remove the htaccess because its not allowing the images to load on the site.
It was originally in the main directory so I tried placing it in the same folder as the images but they still would not load. Any suggestions.
Thanks
|
|
|
Logged
|
|
|
|
webzone (archived)
Official Technical Support
Verified Account
Hero Member
Karma: +0/-0
Offline
Posts: 508
Archived Account
Blog entries
( 0)
|
 |
« Reply #13 on: November 29, 2005, 11:01:35 PM » |
|
which code are you using? i realize that there might be something wrong with the first one (i should check this out), but the second one should work as expected. as a reminder, here is the second code : RewriteEngine on RewriteCond %{HTTP_REFERER} !^(http://(www\.)?freepgs.com/pinkness(/.*)?)?$ [NC] RewriteRule \.(gif|jpg|png)$ / [F,L]
|
|
« Last Edit: December 01, 2005, 07:43:11 PM by webzone »
|
Logged
|
|
|
|
infinity
Verified Account
Newbie
Karma: +0/-0
Offline
Posts: 10
Blog entries
( 0)
|
 |
« Reply #14 on: November 29, 2005, 11:45:55 PM » |
|
Hiya
I just tried the second code and images still can be hotlinked. The first code prevented hotlinking but also prevented images from showing up on the site.
|
|
|
Logged
|
|
|
|
|