Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Are we, Apache Commandos, able to do this:

Open the HTTP Basic Authentication dialog box in a browser only if I request some URL from a specific domain name/server name/host name?

For instance:

If I'd be requesting:


I shouldn't be poping up the HTTP Basic Authentication. But if I'd do this: *(meaning a public internet IP)*

I should get my HTTP Basic Auth poped out, and have my credentials stored under my ".htpasswd", etc.

Is this even posible as I've described it?

share|improve this question

As the documentation describes, HTTP auth can be as granular as you need.

You can certainly decide access by (name-based) vhost, as long as the content they serve is different.

share|improve this answer
meaning I should just add a virtualhost for my specific IP/Hostname/Domainname, and it's directives I can setup the HTTP Basic Auth? – user122976 Jan 28 '13 at 15:13
You should probably spend some time on basic virtual hosting with apache – adaptr Jan 28 '13 at 15:17
that's not the answer to my question: should I just add a directive on the specific domain or not? – user122976 Jan 28 '13 at 15:24
Your question makes bad assumptions; the documentation I pointed you to explains how authentication works. – adaptr Jan 28 '13 at 15:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.