Password protecting a folder causes "Page Not Found" error.

denney - April 25, 2007 - 15:44
Project:Path
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:by design
Description

I have a folder under the root of my Drupal installation that I want to password protect.

Accessing this folder without a .htaccess file works fine. If I add a .htaccess file with the usual password protect content, Drupal starts spitting back a "Page Not Found" error instead of prompting me for a password for the folder.

#1

alienbrain - April 27, 2007 - 17:17
Priority:critical» normal

I've tried password-protecting a folder inside my Drupal root using .htaccess and the instructions from the Apache manual and it worked fine.

If you feel this might be a configuration problem in your end, please set the issue category to 'support'. Thanks.

And this is not critical actually :-)

#2

denney - April 29, 2007 - 15:07
Project:Drupal» Pathauto
Version:5.1» 5.x-2.x-dev
Component:path.module» Code

Hmm... must be my use of Path-auto then. I don't know if this is a configuration error because password protection OUTSIDE the Drupal folder works fine.

I've changed this to the path-auto project because this may be the problem.

BTW... setting priority to critical was a mistake. I must have clicked it when I was writing the bug. sorry.

#3

greggles - April 29, 2007 - 19:15

What makes you think that this is caused by pathauto and not just path module? Pathauto merely creates url_aliases automatically. Try disabling the pathauto module and see if you still have the problem. That should show whether it is from pathauto or not.

#4

greggles - May 1, 2007 - 16:45
Status:active» postponed (maintainer needs more info)

I'm inclined to mark this as "won't fix" because I don't understand how this could be pahtauto's to fix. I'll leave it as needs more info for a while...

#5

denney - May 16, 2007 - 11:23
Project:Pathauto» Path
Version:5.x-2.x-dev» <none>

Yeah, you're right. This is caused by the Path module I believe as I have disabled ALL my 3rd party modules and the issue still exists.

#6

denney - May 16, 2007 - 11:34

OK, I've narrowed it down to the following lines in the .htaccess file of Drupal...

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Removing the first and second lines make no difference. Removing the last line though and the subdirectory works.

#7

r0g - May 17, 2007 - 06:18

Just had this myself.. adding the follwing too my .htaccess ( the one in the subfolder ) worked a treat.

ErrorDocument 401 "Unauthorized"

as per: http://drupal.org/node/30334#comment-125799

r0g.

#8

greggles - May 17, 2007 - 14:19
Status:postponed (maintainer needs more info)» by design

So, I think we can say this is by design and just requires configuration and/or better documentation.

Denny and/or r0g - could either of you write up a handbook page based on that comment and then link to it from this issue? That would really help reduce the problem for other people in the future.

#9

denney - May 19, 2007 - 08:44

I've created a simple page at http://drupal.org/node/145227 explaining the problem with the solution provided by r0g. Feel free to modify and update it as it's my first handbook page.

#10

greggles - May 19, 2007 - 12:47

I don't know much about that area of apache configuration - but I do want to say a big thanks for documenting that! It looks great to me.

 
 

Drupal is a registered trademark of Dries Buytaert.