.htaccess

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
vNightmare
New to forums
New to forums
Posts: 3
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Wed Oct 29, 2014 9:17 pm

.htaccess

Post by vNightmare »

I've already tried support tickets, they advised I posted a thread here so here goes nothing.

For the past week now, I've been trying to design a .htaccess file which limits access to a page using user:pass authentication, however whenever the dialog pops up asking for the credentials, I enter them in all correctly, it sends me to an Error 500 page.

My .htaccess is the following:

Code: Select all

order allow,deny
allow from all
require valid-user
Authname "SECURE AREA - AUTHORIZATION NEEDED"
Authtype Basic
AuthUserFile /usr/www/REDACTED/REDACTED/.htpasswd
Two things redacted to keep the file location and such safe.
User avatar
Spray
Former staff
Former staff
Posts: 630
Joined: Wed Dec 28, 2011 10:41 pm
Location: Oregon

Re: .htaccess

Post by Spray »

Your .htaccess syntax looks correct. If you're getting a 500 error then either the path to the .htpasswd file is incorrect or the .htpasswd file is malformed. Most commonly on our hosting I see customers omit the /public/ folder when specifying the path, ensure you're including this in yours if you're using our default domain path.
vNightmare
New to forums
New to forums
Posts: 3
Joined: Wed Oct 29, 2014 9:17 pm

Re: .htaccess

Post by vNightmare »

Included /public/ and now's it's coming up with the dialog, now here's a new issue that's seemed to pop up.

I've made a test user, specifically for doing this.

It pops up with the dialog as it should, I can enter details and press OK fine, without being redirected to an Error 500, however it doesn't accept the credentials supplied in the .htpasswd file.
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: .htaccess

Post by soja »

Did you remember to hash the password before putting it in the .htpasswd file?
Not a NFO employee
vNightmare
New to forums
New to forums
Posts: 3
Joined: Wed Oct 29, 2014 9:17 pm

Re: .htaccess

Post by vNightmare »

No, and I just done that and it fully works now.

Thank you to those who have contributed, this thread may now be closed.
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: .htaccess

Post by soja »

Glad you got it working!

If you need anything else please ask :)
Not a NFO employee
Post Reply