Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

.htaccess Internal Server Error

Posted on 2012-03-14
8
Medium Priority
?
588 Views
Last Modified: 2012-06-22
hi experts
i get this error after i log in to the secure file:


Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@??????????? and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


my .htaccess looks like this:


AuthUserFile "/.htpasswds"
AuthName "Enter Password"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>

my .htpasswd looks like this:


admin:password



the .htaccess file is in the folder i want to secure and the .htpasswd is in a folder named .htpasswds that is in the very top level that i can get to with filezilla.

file
and the secure file is callad admin inside public_html (public_html/admin)
0
Comment
Question by:helpchrisplz
  • 5
  • 2
8 Comments
 
LVL 2

Expert Comment

by:PaulELS
ID: 37722375
What do your apache error logs say? Also, AuthUserFile "/.htpasswds" should likely be:

AuthUserFile "../../.htpasswds/.htpasswd"

(if the file is called .htpasswd within the .htpasswds directory)
0
 
LVL 1

Author Comment

by:helpchrisplz
ID: 37722515
hi ye i had a look in www folder and got the error_log any way it doesnt have any errors for today only some old php errors from last week.

i have used  AuthUserFile "../../.htpasswds/.htpasswd" but its still giving the same error after i log in
0
 
LVL 2

Expert Comment

by:PaulELS
ID: 37723475
What is the full path and file name of the file that contains the following?

admin:password

Open in new window


Also, you're getting the server error *after* you log in? So you are prompted for username/pass and supply it and then get the error?
0
Cyber Threats to Small Businesses (Part 2)

The evolving cybersecurity landscape presents SMBs with a host of new threats to their clients, their data, and their bottom line. In part 2 of this blog series, learn three quick processes Webroot’s CISO, Gary Hayslip, recommends to help small businesses beat modern threats.

 
LVL 1

Author Comment

by:helpchrisplz
ID: 37723534
yes it allows me to log in and then after submit it does the error.

the file that has admin:password inside it is called .htpasswd and i have put it in the ../../.htpasswds folder. as show on the file tree screen shot


i have also tested with the .htpasswd in the same folder as the one i want to secure and set the link to "../../public_html/admin/.htpasswd" inside the .htaccess file but it has the same error.

i have also used a program called Htpasswd Generator PRO to create the files for me but i get the same error so its must be the link or to do with my hosting?
0
 
LVL 16

Expert Comment

by:sjklein42
ID: 37725571
Inside your login CGI script, it should be doing a redirect to the 'logged-in' page's URL.  It is acting as if that redirect URL is invalid.
0
 
LVL 1

Author Comment

by:helpchrisplz
ID: 37728357
hi after talking to hosting they say my link in the htaccess was bad here is what i have now

AuthName "log in"
AuthType Basic
AuthUserFile "/home/christop/public_html/admin/.htpasswd"
Require valid-user

but now it just reloads the page and asks for the password 3 times then says Authorization Required. This server could not verify that you are authorized to access the document requested.

i am using the user and pass that i have in the .htpasswd file so not sure why it doent just log in ?

the  .htpasswd looks like this:
admin:admin

this is the url of my secured area http://christophersowerby.com/admin

my hosts client area is down so i cant ask more about this over there :P
0
 
LVL 1

Accepted Solution

by:
helpchrisplz earned 0 total points
ID: 37728920
ok my host support is crap. they gave me a bad link. i changed the link and it working. i have this now:

AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/public_html/admin/.htpasswd
AuthGroupFile /dev/null
require valid-user

and i used this site to generate the code and encrypt the password:
http://tools.dynamicdrive.com/password/
0
 
LVL 1

Author Closing Comment

by:helpchrisplz
ID: 37746262
was the link. my host is crap and gave me a bad link.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses
Course of the Month20 days, 21 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question