[thelist] How do you use htpasswd if you're using htaccess and mod_rewrite and have no physical dir structure?

Dunstan Orchard dunstan at 1976design.com
Tue Dec 2 09:56:54 CST 2003

Hi there,

I'm using htaccess amd mod_rewrite to give myself nice urls, eg:

RewriteRule ^stocks((/)?)$ stocks.php [L]

But I'm confused as to what to do when it comes to password protecting 
pages on my site.

Say I need to protect:


How do I do that using htpasswd given that the directory doesn't 
actually exist - where do I put my password rules and password file?

Normally I'd have them here:


With my rules looking like this:

AuthUserFile /home/sites/site34/web/stocks/pwd/.htpasswd
AuthName "Top secret stocks page"
AuthType Basic

<Limit GET>
order deny,allow
require valid-user

Can anyone suggest anything? I'm unable to find any hint of this through 

Thanks very much (could you cc me on any replies please, I'm on digest).

- Dunstan

Dorset, England
Work: http://www.1976design.com/
Play: http://www.1976design.com/blog/
Learn: http://webstandards.org/

More information about the thelist mailing list