Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deny based on directory contents

Status
Not open for further replies.

brain004

Programmer
Oct 18, 2012
1
0
0
US
Hello,

Does Apache provide method to deny access to certain directories based on their contents, say the presence of a ".noaccess" file?

My goal is to provide several aliases to the same directory tree, so that depending on the address used to access that tree certain directories are invisible.

mod_dav will be enabled for these locations. In this way, I will achieve the appearance of several WebDAV directories, each one containing various subsets of a common directory tree.

For example, I may have a tree on my server that contains video and images. The tree is to be available via WebDav using mod_dev to a variety of clients, including desktops, tablets, and mobile devices. The clients will synchronize their own storage with the server tree. In contrast to desktops, which should access all files, tablets should only access to images and low quality video, because of their limited storage capacities. Similarly, mobile devices should only access low quality images.

To distinguish which directories are available to which devices, my idea is to insert tag files such as ".notablet" or ".nomobile" in appropriate directories. Consequently, it is necessary to deny access to certain directories based on their contents, and to do so following different rules depending on the specific alias.

I am aware that the same effect can be achieved by using <Directory> constructs in a configuration file, such as an .htaccess file. The problem with this approach is if the directory tree structure is modified, the configuration file must be changed. In the proposed approach, directories may be shuffled around and the tags will be moved along with them.

Please let me know whether this idea can be achieved.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top