htaccess Elite

Hire htaccesselite professional

$25 non-refundable deposit for me to look at your request,
$175/hr if both parties agree to work request.

.htaccess tutorial


All times are UTC - 5 hours





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: htaccess in subdirectory no prompting for authentication
PostPosted: Apr 28th, '08, 22:38 

Joined: Apr 28th, '08, 22:21
Posts: 1
Hello,

Thanks in advance.

In my top level html dir, I use the htaccess file to push everything that is not a file or a dir through the index where I parse the URL and load the correct content.

Code:
AddType application/x-httpd-php .htm .html .rss
#
RewriteEngine On
Options +FollowSymlinks -MultiViews
#
RewriteBase /
#
DirectoryIndex index.php
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(.*)(.pdf)$
RewriteRule . /index.php [L]


In a subdirectory, I want to do the same thing, except I want to PW protect this dir. Index.html in the subdirectory just lists the files in the dir with some instructions

Code:
AddType application/x-httpd-php .htm .html

AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/########/inc/.htpasswd
require user ########

DirectoryIndex index.html


HERE IS THE PROBLEM.

If I browse to the subdirectory, I am presented with the custom 404 message used in the main directory for unresolved URLs, as if the request was being processed through the top level php content presentation system.

If I delete the htaccess in the in the top level, the subdirectory works as expected (but obviously, the main level content does not) OR, if I delete the htaccess file in the subdirectory instead, I get a regular apache directory listing of the subdir as expected.

It seems the 2 htaccess files are not working with each other some how.

Does anyone recognize this behavior?

Thanks again.

Phlebb


Top
 Profile  
 
 Post subject: Re: htaccess in subdirectory no prompting for authentication
PostPosted: May 9th, '08, 18:43 

Joined: Feb 28th, '07, 11:16
Posts: 40
In the 1st .htaccess file change to:
Code:
Options +FollowSymlinks -MultiViews
DirectoryIndex index.php

AddType application/x-httpd-php .htm .html .rss

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]



In the subdirectory change to:
Code:
DirectoryIndex index.html

Order Deny,Allow
Deny from All
Satisfy Any

AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/########/inc/.htpasswd
Require user ########


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB