Set a password on all (sub)domains of a user

Arne

New member
Joined
Mar 15, 2011
Messages
3
I have an account within DA that is used as an acceptance server, it contains a lot of subdomains, each containing a copy of a website for the client to look at and give approval to modifications before they are applied to the live server.
The subdomains should be protected with a password to prevent unauthorized access from users and search engines.
It would be great if there was a way to automatically protect all those subdomains with a password, instead of having to add a .htaccess to each domain manually. (and having the risk of forgetting it or get conflicts with existing .htaccess files)

Is there a way to do this? Like adding something to the virtualhost?
 
I forgot to mention; I use the domain administration feature to add subdomains, so we're not talking about subdirectories within a domain. Furthermore, It's not a problem if the user/password combination on all subdomains are the same.
 
Even if the subdirectories are added as somains, you should still be able to keep search engines out by using a robots.txt file; information here.

You can use a post creation shell script to automatically add the .htaccess information for you after creation of a new domain based on value of the domain.

Jeff
 
You can password protect any directory you want in file manager.
You were right, I've just placed a .htaccess and .htpasswd in the /domains directory and it worked. Never knew that this was possible :)

Even if the subdirectories are added as somains, you should still be able to keep search engines out by using a robots.txt file; information here.

You can use a post creation shell script to automatically add the .htaccess information for you after creation of a new domain based on value of the domain.

Jeff
This is true, but the problem is that some search engines ignore the robots.txt, and it's still possible to forget to upload the right robots.txt and before you know it you're indexed everywhere and the client is not happy.
 
Back
Top