Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
htaccess and Textpattern Section *Solved*
Hello! I’ve been having some issues with password protecting a txp section on my site. The htaccess file looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*) /mnt/local/home/user/site/index.php
</IfModule>
AuthType Basic
AuthUserFile /mnt/local/home/user/site/employees/.htpasswd
AuthName “Employees Only”
require valid-user
From all my research and numerous posts from ruud, this shoud do the trick, but this section is still accessible with no password needed.
mod_rewrite is on and I’m positive I have the paths right, but I can’t seem to figure this out…
Any help is appreciated!
=============Solved======================
Alright, with Els help and with some fancy Googling, I came up with the following:
My host (Dreamhost) runs PHP as CGI. My limited experience with PHP and CGI prohibits me from explaining any further, but by adding this line:
AddHandler application/x-httpd-php .php
to the .htaccess file in my site’s root, I was able to get the Txp password_protect working perfectly. Thanks for all the help, guys!
Last edited by surfwax95 (2008-06-04 01:53:27)
Caps lock is cruise control for cool. —Unknown
Offline
Re: htaccess and Textpattern Section *Solved*
Instead of htaccess did you try the native password_protect or if your users are registered in the system rvm_privileged might come handy.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: htaccess and Textpattern Section *Solved*
Colak,
Thanks for your help. I didn’t know about Txp’s native password protection and the security is not that important, so it should work fine.
However, it just doesn’t work for me. I’ve tried three times now and even though I’m typing in the correct credentials it won’t let me view the section I’m requesting. Any help here? Do I have to do anything else other than add the line to the top of my page?
Caps lock is cruise control for cool. —Unknown
Offline
#4 2008-05-31 22:44:07
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: htaccess and Textpattern Section *Solved*
surfwax95 wrote:
Do I have to do anything else other than add the line to the top of my page?
I have always used it after the <body>
tag and that works. If it still doesn’t work, have a look at this post, apparently it also depends on your server setup.
Edit: there is also a plugin.
Last edited by els (2008-05-31 22:46:46)
Offline
Re: htaccess and Textpattern Section *Solved*
Els,
The plugin you recommended caused my Txp admin area to show lines of PHP errors at the top. I think this may be because I’ve edited the lib/txp_head file to alter the admin area. Regardless, it’s not working for me.
I’d really like to get the default Txp password protection working, but after reading through the thread you posted, I would have no idea how to configure my server. My diagnostics tab shows PHP in CGI mode, but I don’t know what it needs to be in order to get the passwords working.
Any more help is appreciated!
Caps lock is cruise control for cool. —Unknown
Offline
#6 2008-06-03 15:07:22
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: htaccess and Textpattern Section *Solved*
Here is what did and did not work for me, hope it will help you.
Offline