Password protecting a subdomain


#1

How do I require a username and password for access to a subdomain? These would be the same for all users.

For my prior ISP, I user .htaccess and .htpassword files to do this:

htaccess:
AuthUserFile /home/[username]/[subdomain]/.htpasswd
AuthGroupFile /dev/null
AuthName nobod
AuthType Basic

require valid-user

htpassword:
username:password

But I get internal server errors when I do this in Dreamhost.

What should the permissions be on these files if this will work?

Thanks,

Bill


#2

Let DreamHost do all the hard work for you. For more info and instructions, read this article: https://panel.dreamhost.com/kbase/index.cgi?area=801


MacManX.com
I don’t work here. I’m just your typical support forum volunteer.


#3

Yeh that is what I did.

But…

The directory is protected if the URL is www.subdomain.domain.com.
It is not protected if the URL is subdomain.domain.com without the www.

Bill


#4

I’d have to say that I highly doubt that. I’m password protecting a sub-domain right now. Log into your Control Panel and go to Domains/Web. Hit “Edit” for the sub-domain in question and make sure that “Always add ‘www.’” is not selected.


MacManX.com
I don’t work here. I’m just your typical support forum volunteer.


#5

I ran into this recently. I have both with and without “www” as valid options. Then I realized I hadn’t cleared my browser settings (just closed all the windows and started fresh for each test) and then it was fine.

Lu