# .htaccess for pages?

**URL:** <https://www.ruby-forum.com/t/htaccess-for-pages/91729>\
**Category:** Radiant CMS\
**Created:** [April 11, 2007, 10:33pm UTC](https://www.ruby-forum.com/t/htaccess-for-pages/91729 "2007-04-11T22:33:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluetrust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Post date:** [April 11, 2007, 10:33pm UTC](https://www.ruby-forum.com/t/htaccess-for-pages/91729/1 "2007-04-11T22:33:44Z")

</div>

Hello-

I’m having a problem getting .htaccess to work on an area of my site.  
Is anyone else using a .htaccess file to protect certain directories on  
their radiant sites?

I have a secondary level page called ‘staff’

http::/somesite.com/staff

I created a directory ‘public/staff’ and placed a .htaccess file in  
there.

The .htaccess file is not working. Is it possible to do this? Are there  
some other things I need to change?

Thanks-  
Michael

---

<div class="post-metadata">

**Author:** ![bluetrust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Post date:** [April 11, 2007, 11:07pm UTC](https://www.ruby-forum.com/t/htaccess-for-pages/91729/2 "2007-04-11T23:07:48Z")

</div>

You might try putting your directive directly in the root .htaccess  
file and then scope it down to /staff

example, put something like:

```
    <Directory /staff>
            AuthType Basic
            AuthName "Password Required"
            AuthUserFile /somewhere/staff.htpasswd
            Require valid-user
    </Directory>

```

somewhere BEFORE the call to:

RewriteRule ^(.\*)$ dispatch.fcgi [QSA,L]

As soon as Apache has called dispatch.fcgi, it’s Rails handling  
everything, and nobody is checking your htaccess

---

<div class="post-metadata">

**Author:** ![bluetrust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Post date:** [April 19, 2007, 4:55pm UTC](https://www.ruby-forum.com/t/htaccess-for-pages/91729/3 "2007-04-19T16:55:09Z")

</div>

Thanks for the reply Jacob, this did work however when it authorizes  
you it just renders a blank page and does not hand off control to  
Radiant.

Since I was in a pinch I did some hacking and got it to work, but if  
anyone finds a clean way to require authorization for a collection of  
pages and still use Radiant please post it to the list, I think that  
would be helpful.

Thanks-  
MJ
