500 Internal Server Error with protected directory using .htaccess

4 posts by 2 authors in: Forums > CMS Builder
Last Post: November 4, 2008   (RSS)

By pcolvin - November 1, 2008

I have searched through the other threads looking for a similar problem, but none were able resolve my problem.

I am using a user management system (Deadlock - www.phpdeadlock.org) to protect a directory and manage the users that can access that directory.

I have that system working fine, and it creates the .htaccess and .htpasswd files and puts them in the protected folder.

When I browse to the protected folder (www.mydomain.com/protected) it prompts for the user name and password, and if entered correctly will allow me in. However, if I put an index.php file in the directory I get a 500 Internal Server Error. If I change the file name to index.html it will open.

I would like to have several .php files managed by CMSB in the protected directory which will serve as a Intranet for the organization.

Any help will be greatly appreciated.

P. Colvin

Re: [pcolvin] 500 Internal Server Error with protected directory using .htaccess

By Dave - November 3, 2008

Hi pcolvin,

So any index.php (not just a CMS Builder viewer) causes as error?

Some questions:
- Do php files with other names work in the directory?
- Do index.php files work in other directories.
- If you temporarily remove the htaccess/htpasswd does the index.php work?

The answers to those questions might help track down the cause. Also make sure the /protected/ directory and php file aren't writable to anyone but the user (chmod 755). Some Apache web servers are configured to not all php files to run if they are writable or in a writable directory.

If that's the problem try setting the dir and index.php file to chmod 755. If that works test that your deadlock program can still update it's htaccess/htpassword files.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] 500 Internal Server Error with protected directory using .htaccess

By pcolvin - November 3, 2008

Dave,

[font "Verdana"]So any index.php (not just a CMS Builder viewer) causes as error?
- Yes any index.php file causes the error.[/#0000ff]
[font "Verdana"]

Some questions:
- Do php files with other names work in the directory? No. All files cause the error.[/#0000ff]
- Do index.php files work in other directories. Yes[/#0000ff]
- If you temporarily remove the htaccess/htpasswd does the index.php work? Yes[/#0000ff]


I'll try the 755 permissions and see if that helps.

Thank you for the response.

Phil