Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-14 22:30:32

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Password protected directories and TXP 4.0.3

I have a directory that is password protected using .htaccess authentication. I’ve seen several threads regarding this issue in the forums and tried all of the fixes that were receommended with no luck.

I am using the standard Textpattern .htaccess file in my root directory and have a subdirectory password protected. If I remove the password protection I can view the page in that subdirectory but with it I get a 404. Here are the contents of the .htaccess file in my subdirectory.

AuthType Basic
AuthName “Restricted Area”
AuthUserFile “/full/path/to/.htpasswds/dir/passwd”
require valid-user

Any ideas on how to fix this would be appreciated.

Offline

#2 2006-01-14 22:52:40

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Password protected directories and TXP 4.0.3

I can’t find the topic, but someone suggested, that adding ErrorDocument 40x documents (to static files) helps. I’ll see if I can dig out that topic…

Offline

#3 2006-01-14 23:34:52

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Password protected directories and TXP 4.0.3

No need to dig, I admit I was the one. Read the whole story over there. But Rob seems to have already read it, jugdging by the links he posted.

Last edited by wet (2006-01-14 23:39:25)

Offline

#4 2006-01-15 02:21:56

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: Password protected directories and TXP 4.0.3

Very nice! Thanks wet. That did the trick. I read the thread but got caught up with all the other potential solutions mentioned before yours and didn’t make it to the end I guess.

Offline

#5 2006-01-15 09:34:09

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Password protected directories and TXP 4.0.3

As a sidenote: I’ve pointed somebody to my solution quite often during the three or so weeks since I had success with it and suspect that this will turn into an emerging pattern.

Is anybody considering to put this into the FAQs? Or even integrate some commented ErrorDocument directives into the distributed .htaccess file?

Offline

#6 2006-01-15 12:28:46

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Password protected directories and TXP 4.0.3

Thanks, wet. I was waiting a few more confirmations, because I still find the solution o be a bit surprising. My gues is that those hosting companies use an ErrorDocument directivethat starts with http://… to a file-location within textpattern’s path that doesn’t exist.

I’ve added the the FAQ item now:
http://textpattern.com/faq/173/password-protected-directories-with-htaccess

Again, thanks for finding and documenting the solution. :)

Offline

#7 2006-01-15 14:42:05

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Password protected directories and TXP 4.0.3

A tiny suggestion:

The webserver tries to serve<strong><del> r </del></strong> the corresponding, specified Errordocument.

Last edited by wet (2006-01-15 14:49:12)

Offline

Board footer

Powered by FluxBB