how to set user for access .htdocs folder ?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

how to set user for access .htdocs folder ?

Post by valen53 »

Purpose : prevent users access the "secret folder" under .htdocs.

after read through the apache manual, i still dunno how to block the .htdocs.
even i change the userdir to : UserDir disabled root
but not workingly.

copy from Apache manual / UserDir directive
To allow a few users to have UserDir directories, but not anyone else, use the following:
UserDir disabled
UserDir enabled user1 user2 user3
It mean we can set uset to accessing it, is it possible ? how to do it ?
i can't find the any tutorial from the manual.

anyone can help me ?

thank a lot
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I'm not quite sure what you want to achieve.
What do you mean... secret folder.
http://httpd.apache.org/docs-2.0/mod/mod_userdir.html#userdir wrote:UserDir Directive
[...]
Context: server config, virtual host
you can't use it in .htaccess.
If this is about authentication you might find http://httpd.apache.org/docs-2.0/howto/ ... .html#auth more interesting
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

Post by valen53 »

What do you mean... secret folder.
actully is the folder that only view by admin but not for client.
such as
user type URL ...
http://www.domain.com/picture/

so user can see the file in the picture folder.

But we dunwant to let them to browse this folder. only for admin can browse it.


thanks for ur reply
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

But we dunwant to let them to browse this folder. only for admin can browse it.
Not allow to access any file in this directory at all or just disable the index-view for non-admins?
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

Post by valen53 »

Not allow to access any file in this directory at all.

actually i have one solution. i put a index.php file to that directory.
so when user browse to that directory, they will redirect to my homepage again.

But any other ways to not allow user access it ?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

If this is about authentication you might find http://httpd.apache.org/docs-2.0/howto/ ... .html#auth more interesting
Post Reply