Portal Home > Knowledgebase > Articles Database > need help with rewrite for image control


need help with rewrite for image control




Posted by durangod, 10-02-2012, 10:22 PM
Hi i tried this rewrite but it does not do what i want, as a matter of fact it blocks most images from all sites. I have three sites on the same CPanel and i want to share images between them but i do not want people to hotlink to the images. here is the rewrite, if the referrer is from one of these sites its ok the release the image. i also tried L,NC AND NC,L on each line but it blew up on me with server error. Thanks in advance.

Posted by foobic, 10-02-2012, 10:48 PM
Something like this should be all you need:

Posted by durangod, 10-02-2012, 11:17 PM
thanks i will try that,i took an example from an online tutorial and didnt work either. Question, do i need to just post that in the public html or does that need to go inside of every add on domain htaccess file. The add on domains are the ones i want to be sharing. so what i have is this; public html site0 would prefer not to share if i can do that addon domain site1 share images addon domain site2 share images addon domain site3 share images UPDATE; we are one step closer, at least the images for the site pages are not being blocked now and its not blocking its own images. but are you familiar with this image attached, thats what i get when i try to grab the image from the other site, does this image come from Cpanel (hotlinking is off) Attached Thumbnails   Last edited by durangod; 10-02-2012 at 11:32 PM.

Posted by foobic, 10-02-2012, 11:35 PM
It needs to go in the public_html for whatever site holds the images you're trying to share / protect. If you have images in multiple sites then you'd need these rules to apply to the other sites also. However the way Apache .htaccess files work, if you use the rules once in the .htaccess for the main site they will probably also apply to addon domains in subdirectories automatically (unless overridden by other rules in subdirectory .htaccess files). Edit: You probably have something else in a .htaccess somewhere (ie. hotlink protection is really on) redirecting to that image.

Posted by durangod, 10-02-2012, 11:45 PM
could it be this i dont know what this does, i added it a long time ago from a conversation with my old host but i cant remember what it does, this time i will put doc in the file so i remember lol. Could this be it. follow symlinks is above this and i know thats a good thing so ill leave that right. and i know that at times i have to force things using a php value in or flag in htaccess because php ini does not set it, so i will make sure that hotlinking is off.

Posted by durangod, 10-03-2012, 12:08 AM
ok i think i may have found it, the site is a phpbb site and the gallery has its own htaccess set up for each image file, i finally thru searching all the folders found the image i shows you. So thats where it is comming from, not Cpanel and not the server, the phpbb gallery is blocking it. So at least i know where to research. Thanks for your help your awesome peace



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
squirrelmail (Views: 580)
rvskin (Views: 616)