# .htaccess protection of public folder

**URL:** <https://www.ruby-forum.com/t/htaccess-protection-of-public-folder/159352>\
**Category:** Rails\
**Created:** [February 3, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/htaccess-protection-of-public-folder/159352 "2009-02-03T19:46:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [February 3, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/htaccess-protection-of-public-folder/159352/1 "2009-02-03T19:46:57Z")

</div>

during staging devs, I want to protect the access to the site

I wrote the folwoing into an .htaccess file in my public directory

# Access control policy

AuthType Basic  
AuthName “AelmatRepository”  
AuthUserFile /etc/apache2/dav\_aelmat.passwd  
Require valid-user

works fine… BUT there is no access to the css and images… !!!

I belive I should add sometbing in my environment ? but what ?

thanks for your help

erwin

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [February 3, 2009, 9:16pm UTC](https://www.ruby-forum.com/t/htaccess-protection-of-public-folder/159352/2 "2009-02-03T21:16:41Z")

</div>

You’re probably better off asking this in an Apache forum.

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [February 3, 2009, 11:30pm UTC](https://www.ruby-forum.com/t/htaccess-protection-of-public-folder/159352/3 "2009-02-03T23:30:34Z")

</div>

well… these are the standards for Apache… the problem is rather  
with Rails deployment and Passenger I guess ?
