# .htaccess in public and adding password protection

**URL:** <https://www.ruby-forum.com/t/htaccess-in-public-and-adding-password-protection/67730>\
**Category:** Rails\
**Created:** [September 6, 2006, 12:33pm UTC](https://www.ruby-forum.com/t/htaccess-in-public-and-adding-password-protection/67730 "2006-09-06T12:33:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AFM](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@AFM](https://www.ruby-forum.com/u/AFM)\
**Post date:** [September 6, 2006, 12:33pm UTC](https://www.ruby-forum.com/t/htaccess-in-public-and-adding-password-protection/67730/1 "2006-09-06T12:33:58Z")

</div>

While my site is in development I wish to add basic password protection.  
At the moment my .htaccess looks like this:

AuthName “Restricted Area”  
AuthType Basic  
AuthUserFile /home/httpd/mydomain.co.uk/.htpasswd  
AuthGroupFile /dev/null  
require valid-user

.htpasswd exists and has an entry, yet I do not get a password prompt?

Does Apache Auth work for dynamic resources or only static files?

Many thanks 🙂

---

<div class="post-metadata">

**Author:** ![AFM](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@AFM](https://www.ruby-forum.com/u/AFM)\
**Post date:** [September 12, 2006, 11:52am UTC](https://www.ruby-forum.com/t/htaccess-in-public-and-adding-password-protection/67730/2 "2006-09-12T11:52:25Z")

</div>

AFM wrote:

> While my site is in development I wish to add basic password protection.  
> At the moment my .htaccess looks like this:
> 
> AuthName “Restricted Area”  
> AuthType Basic  
> AuthUserFile /home/httpd/mydomain.co.uk/.htpasswd  
> AuthGroupFile /dev/null  
> require valid-user
> 
> .htpasswd exists and has an ent

ry, yet I do not get a password prompt?

> Does Apache Auth work for dynamic resources or only static files?
> 
> Many thanks 🙂

Any ideas? 🙂

---

<div class="post-metadata">

**Author:** ![AFM](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@AFM](https://www.ruby-forum.com/u/AFM)\
**Post date:** [September 12, 2006, 3:08pm UTC](https://www.ruby-forum.com/t/htaccess-in-public-and-adding-password-protection/67730/3 "2006-09-12T15:08:57Z")

</div>

On Sep 12, 2006, at 5:52 AM, AFM wrote:

> AFM wrote:
> 
> > While my site is in development I wish to add basic password  
> > protection.  
> > At the moment my .htaccess looks like this:
> > 
> > AuthName “Restricted Area”  
> > AuthType Basic  
> > AuthUserFile /home/httpd/mydomain.co.uk/.htpasswd

Where is this file? Apache seems to refuse to use password files that  
are in a directory that it is serving content from.

Cheers,  
Bob

> > Many thanks 🙂
> 
> Any ideas? 🙂
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

* * *

Bob H. – blogs at \<[http://www.recursive.ca/](http://www.recursive.ca/)  
hutch/\>  
Recursive Design Inc. – [http://www.recursive.ca/](http://www.recursive.ca/)  
Raconteur – [http://www.raconteur.info/](http://www.raconteur.info/)  
xampl for Ruby – [http://rubyforge.org/projects/xampl/](http://rubyforge.org/projects/xampl/)
