Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have an Apache webserver, and in the Apache configuration, I have

Alias /backups "/backups"
<Directory "/backups">
    AllowOverride None
    Options Indexes
    Order allow,deny
    Allow from all
</Directory>

I can access files via http://127.0.0.1/backups. The problem is everyone can access that.

I have a web interface, e.g. http://localhost/adminm that is protected with htaccess and password.

Now I don't want separate .htaccess and .htpasswd for /backups, and I don't want a second password prompt when a user clicks on /backups in the web interface. Is there any way to use same .htaccess and .htpasswd for the backups directory?

share|improve this question
    
i think it more of linux knowledge than web . At webmasters linux tag has only 27 questions . –  Mirror51 May 21 '11 at 15:51
    
@Mirror51: Linux is not relevant to your question. Since your users are accessing the files through a web interface, the access control is performed by Apache, not Linux. –  Gilles May 21 '11 at 15:52
add comment

migrated from unix.stackexchange.com May 21 '11 at 22:25

This question came from our site for users of Linux, FreeBSD and other Un*x-like operating systems..

1 Answer

Yes. Anything you set in .htaccess you can set in the Apache configuration.

What you'll do is add the directives from your /admin .htaccess to your /backup directory context.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.