Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is thier a feature or something I could do to block people from linking my images out of my domain, something like geocities or tripod does! I would like to do this for the fact that if somebody posts alot of images being accessed it will take away from my total server bandwith and resources!
This basically says if you have a referer that is not blank and not from your site or a site you allow to link images (trusted.com) then rewrite the request to - and give a forbidden response. You could replace the last line with:
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,597
Rep:
First make sure you have mod_rewrite enabled (although apache should have errored on restart if you didn't). You can put the chunk of code in the virtual host statement of the site you want to protect. How are you testing this?
Originally posted by jeremy First make sure you have mod_rewrite enabled (although apache should have errored on restart if you didn't). You can put the chunk of code in the virtual host statement of the site you want to protect. How are you testing this?
--jeremy
I' testing this by adding an image tag to another forum which allows pics to be posted! Mod_rewrite is enabled!
I dont have any virtual hosts set up! Just 1 main site under the /home directory!
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,597
Rep:
You should just be able to put the rewrite statements at the end of the file then (or almost anywhere outside of another statement). Are you getting any errors? You may want to turn rewrite logging on:
This will log EVERYTHING so don't leave it that way for production, just so we can figure out what is happeneing. You can adjust the path to suit your setup.
Finally got this to work a bit but the image shows up as a red X and you right click and it still shows the original linking to the pic! The RewriteRule doesent seem to change the link to the image??
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.