Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Web Design

Notices

Reply
 
Thread Tools
  #1  
Old 02-05-2012, 12:13 PM
nielsdb nielsdb is offline
Hatchling Croc
 
Join Date: Sep 2010
Posts: 6
Default htpasswd leading to 404 page.

This is the page giving me a 404 error:
http://174.120.180.34/~nielsdb/database/admin/

htaccess (in /public_html/database/admin):
Code:
AuthName "Authorisation required"
AuthUserFile "/home/nielsdb/.htpasswds/public_html/database/admin/passwd"
AuthType Basic
require valid-user
passwd (in /.htpasswds/public_html/database/admin)
Code:
Niels:y6uyhUR7UFpLg
When I delete the htaccess file, the site loads just fine, hence I'm pretty sure that file is causing the 404 error.

I really have no clue why it is doing that though.

Hoping for help

sincerely,
Nielsdb
Reply With Quote
  #2  
Old 02-05-2012, 01:45 PM
freeman's Avatar
freeman freeman is offline
Swamp Croc
 
Join Date: Jan 2006
Location: Montreal, QC, Canada
Posts: 308
Default Re: htpasswd leading to 404 page.

Quote:
Originally Posted by nielsdb View Post
This is the page giving me a 404 error:
http://174.120.180.34/~nielsdb/database/admin/

htaccess (in /public_html/database/admin):
Code:
AuthName "Authorisation required"
AuthUserFile "/home/nielsdb/.htpasswds/public_html/database/admin/passwd"
AuthType Basic
require valid-user
passwd (in /.htpasswds/public_html/database/admin)
Code:
Niels:y6uyhUR7UFpLg
When I delete the htaccess file, the site loads just fine, hence I'm pretty sure that file is causing the 404 error.

I really have no clue why it is doing that though.

Hoping for help

sincerely,
Nielsdb
There is no "admin" directory inside "database" directory.
You have just one file inside "database" directory: aanmelding.php
So, the 404 error is normal.


Regards
Reply With Quote
  #3  
Old 02-05-2012, 02:10 PM
nielsdb nielsdb is offline
Hatchling Croc
 
Join Date: Sep 2010
Posts: 6
Default Re: htpasswd leading to 404 page.

The admin/ folder shows in the directory index when I delete the .htaccess file inside it...?
Reply With Quote
  #4  
Old 02-05-2012, 02:26 PM
quietFinn's Avatar
quietFinn quietFinn is offline
Veteran Croc
 
Join Date: Feb 2005
Posts: 3,557
Default Re: htpasswd leading to 404 page.

see if it helps if you add a line:

RewriteEngine On

in 1st line of the .htaccess file
__________________
quietFinn - netFinn Finland
"Be who you are and say what you feel because those who mind don't matter and those who matter don't mind." - Dr. Seuss
Reply With Quote
  #5  
Old 02-06-2012, 03:37 PM
nielsdb nielsdb is offline
Hatchling Croc
 
Join Date: Sep 2010
Posts: 6
Default Re: htpasswd leading to 404 page.

Didn't work. Also tried deleting the .htaccess and htpasswd file and setting a new password with the "Password Protect Directories" function in cPanel, same 404 page.
Reply With Quote
  #6  
Old 02-06-2012, 07:21 PM
freeman's Avatar
freeman freeman is offline
Swamp Croc
 
Join Date: Jan 2006
Location: Montreal, QC, Canada
Posts: 308
Default Re: htpasswd leading to 404 page.

Quote:
Originally Posted by nielsdb View Post
This is the page giving me a 404 error:
http://174.120.180.34/~nielsdb/database/admin/

I just see it now. There is a problem with htaccess:
Wrong:
Code:
AuthName "Authorisation required"
AuthUserFile "/home/nielsdb/.htpasswds/public_html/database/admin/passwd"
AuthType Basic
require valid-user
corect
Code:
AuthType Basic
AuthName "Authorisation required"
AuthUserFile "/home/nielsdb/.htpasswds/public_html/database/admin/passwd"
require valid-user
Regards,
George B.
Reply With Quote
  #7  
Old 02-07-2012, 07:04 AM
GatorMusee's Avatar
GatorMusee GatorMusee is offline
HostGator Staff
 
Join Date: Jun 2011
Location: Austin, TX
Posts: 1,322
Default Re: htpasswd leading to 404 page.

Please use:

Code:
AuthName "Authorisation Required"
AuthUserFile "/home/nielsdb/.htpasswds/public_html/database/admin/passwd"
AuthType Basic
require valid-user
ErrorDocument 401 "Authorisation Required"
Apache had changed this somewhat and specifying the 401 error document is necessary as Apache is looking for it when using .htpasswd.
__________________
Musee U.
L1 Systems Administrator || Systems Monitoring
Reply With Quote
  #8  
Old 02-08-2012, 12:34 PM
nielsdb nielsdb is offline
Hatchling Croc
 
Join Date: Sep 2010
Posts: 6
Default Re: htpasswd leading to 404 page.

That did the trick, thank you very much!

Sincerely,
Nielsdb
Reply With Quote
  #9  
Old 02-10-2012, 05:00 AM
satnav's Avatar
satnav satnav is offline
Swamp Croc
 
Join Date: Jul 2011
Posts: 257
Default Re: htpasswd leading to 404 page.

Quote:
Originally Posted by nielsdb View Post
The admin/ folder shows in the directory index when I delete the .htaccess file inside it...?
This is a wrong move. Can you still restore it back inside the folder?
__________________
Dedicated HostGator Love
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
404 page not found soysce Linux VPS Support 4 03-05-2010 06:55 PM
Help with 404 page bfuller Webhosting 3 08-11-2009 12:25 PM
404 page not found joebrown Pre-Sales Questions 1 06-01-2009 05:09 PM
404 error page Abdulaziz Shared Hosting Support 10 11-12-2008 05:16 PM
Getting a 404 on a .php page woosterbert Shared Hosting Support 13 08-17-2008 12:42 PM

All times are GMT -5. The time now is 06:53 AM.