|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
securing a dir on server
Hey there,
I am trying to find a script to keep folks from linking to files on my server. I have a few dirs, that I would like to allow folks to link images and such from, but most of the others I want to restrict access to. I was told this could be done through some sort of apache mod, but I am at a loss when it comes to that. I'm not sure exactly how to do this, or what sort of script would do it, therefore I didn't post in a more specific board. Any help would be much appreciated. Thanks, -Ditch |
|
#2
|
||||
|
||||
|
Wouldn't it be easiest just to set the permissions of the directory so that web users can't access it?
|
|
#3
|
|||
|
|||
|
I was thinking about the chmod, but wouldn't that restrict access to other things as well? Also, if I were to do that, would I have to chmod each particular file, or would just setting the permissions on the dir work?
Thanks for the response. |
|
#4
|
||||
|
||||
|
When you chmod a directory, you're restricting things related to the directory:
Listing the contents, writing new files to it, etc. If you just chmod the directory for no access, people can still access a file if they know the full path to it already. You would need to chmod each individual file, but that's not too tough. |
|
#5
|
||||
|
||||
|
Search apache forum for mod_rewrite and image hotlinking - this sort of questions pop up nearly every day and have been answered many times.
__________________
And you know I mean that. |
|
#6
|
|||
|
|||
|
Thanks AlCapone, I'll have a look around in there.
|
|
#7
|
|||
|
|||
|
chmod it 751
|
|
#8
|
||||
|
||||
|
Wait... are you trying to totally restrict access to everything in the directory, or only certain files?
|
|
#9
|
|||
|
|||
|
Well actually what I would like to do, is to restrict someone from using an image or any file in a particular dir, to say link onto their site. I have one dir, that I allow my members to use, for images they use on other forums and such, but I don't want that option to be available with the rest of the site's files. Like if someone wanted to link me from their site, and just linked my banner rather than upload it to their server, I want to stop that....heh. Sorry, having trouble explaining myself tonight.
Also, another thing I was trying to figure out how to do, is to stop search engines from accessing various pages within my website. I would like it so that the only page that ever shows up, is the 'index.html.' I would like to do the same thing with everyone really, so that if someone linked my forums, they would be automatically redirected to the index.html. I believe someone mentioned a meta tag like 'bots=o' or something, and they then told me I would have to resubmit my site to all of the engines. I figure there must be a way to keep the web crawling out, and have any links that show up be redirected to my index page, without having to go through the process of re-submitting. Thanks for your help. |
|
#10
|
|||
|
|||
|
Ok, I figured out the search engine & meta tag part, and figured out how to modify the htaccess file so that people can't hotlink to images, but I am still at a loss on how to redirect other sites who direct link to specific pages within my site, to the index.html.
A friend did this with asp I know, but that is not an option for me. |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > securing a dir on server |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|