Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 17th, 2001, 09:20 AM
simovsky simovsky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 13 simovsky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
.htaccess protecting _only_ some dirs

I'm usinf apache with win32, I have the document root at c:/Pages/ and in the document root I have a .htaccess that works perfectly, asking for a password.
I have various dirs in c:/pages/.
Example:
-Dir01
-dir02
-dir03
(...)
How can I configure .htaccess to protect only dir02 and dir03, and not dir01?

I hope you can help me.

Best Regards,
Simao Mata

Reply With Quote
  #2  
Old November 17th, 2001, 01:08 PM
4wzdr|X 4wzdr|X is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: oShaWa
Posts: 52 4wzdr|X User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
take it out of the htaccess path

Reply With Quote
  #3  
Old November 17th, 2001, 03:56 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> How can I configure .htaccess to protect only dir02 and dir03, and not dir01?

Just place your .htaccess in dir02 and dir03. Or you can configure a <Directory "/path/to/dir02"> and dir03, respectively.

Reply With Quote
  #4  
Old November 17th, 2001, 09:22 PM
simovsky simovsky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 13 simovsky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
But if I take .htaccess of the document root, the document root is no longer protected, I want the root to be protected.
In another hand, if I put .htaccess in the documentroot, all the dirs in it, will be protected.

Regards,
Simao Mata

Reply With Quote
  #5  
Old November 18th, 2001, 05:37 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> the document root is no longer protected

In your first post you said you want to protect dir2 and dir3, not dir1 and you also didn't mention you want your docroot to be protected as well. So why don't you post one more time and tell us what directories exactly you want to protect? Also give us a docroot (with directory layout) would be helpful.

Reply With Quote
  #6  
Old November 18th, 2001, 09:06 AM
simovsky simovsky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 13 simovsky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
My document root is c:/pages/ I have dir01, dir02 and dir03 inside c:/pages/.
I want to protect dir02, dir03, and c:/pages/, and I want to leave dir01 unprotected.

If I put a .htaccess file in the document root all the dirs will be protected, but I want to leave dir01 unprotected.

Thanks for your help,
Sorry for my lousy english.
Regards,
Simao Mata

Reply With Quote
  #7  
Old November 18th, 2001, 02:02 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Don't use .htaccess, configure it in httpd.conf like so:

<Directory "c:/pages">
AuthType Basic
AuthName "Private Area"
AuthUserFile c:/path/to/.htpasswd
Require valid-user
</Directory>
<Directory "c:/pages/dir1">
Allow from all
Satisfy any
</Directory>

Reply With Quote
  #8  
Old November 18th, 2001, 03:22 PM
simovsky simovsky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 13 simovsky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It works fine!
Thanks for your help.
Regards,
Simao Mata

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > .htaccess protecting _only_ some dirs


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT