Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
multiple .htaccess files
Old 07-23-2004, 03:16 AM multiple .htaccess files
Novice Talker

Posts: 11
Trades: 0
I am trying to implement a system whereby only one subdirectory of my website requires a log and passwd. In the root folder I have an .htaccess files which merely sets my own default error pages and performs some permanent redirections, includes nothing about authorisation. Then i created a second .htaccess file in the subdirectory i want to protect with the authoriastion code:

AuthUserFile /html/.htpasswd
AuthName "Protected Access"
AuthType Basic

<LIMIT GET POST>
Require valid-user
</LIMIT>
I know this code is all correct and the unix path to the .htpasswd file is correct because when i delete the .htaccess file in the root folder, the login and pass works fine when accessing the sub-directory, it is only when they are both there, the second one, is not being allowed to work, when i try to access a page within that subdirectory i just get an error page.
Any ideas on how to get them both working at the same time ???
hodgy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-23-2004, 05:26 AM hi
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
Could it be that because you have 2 .htaccess files in the one folder is creating confusion? Also does your server (host) support this?


Mik
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 07-23-2004, 05:49 AM
Novice Talker

Posts: 11
Trades: 0
problem was (for anyone who finds themselves in same situation) that I had defined a custom error page for error 401 in the root .htaccess file. error 401 however is the "authorisation required" error page. Therefore the .htaccess file in the sub-directory which contained authorisation info was being rendered useless because as soon as apache saw that the webpage being requested required authorization it looked in the .htaccess file in the root folder (nb .htaccess search hierarchy) and computed the custom error page for error 401 and terminated, therefore the .htaccess in the sub-directory was never going to work. Lesson learnt.
hodgy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to multiple .htaccess files
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14938 seconds with 12 queries