Jump to content

Protect DIR but allow access to a file/files


peepsnet

Recommended Posts

I am lookin for a way to password protect a directory but allow "access to all" to a few files. I am running a webstats package and only want visitors to be able to access the javascript file that is included on each webpage.

 

using .htaccess

 

Thanks,

Don

 

Link to comment
Share on other sites

So you want:

 

Use htaccess & htpasswd to protect an entire Directory.

Allow exceptions to particular files within that Directory

 

I don't think it is possible. What you could do is:

1. Obviously use two separate directories.

2. Use htaccess & htpasswd to protect particular filetypes using a wildcard, e.g. *.jpg.

 

-steve

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.