0

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:

localhost
some_custom_localhost
127.0.0.1
192.168.1.123
etc...

I shouldn't be poping up the HTTP Basic Authentication. But if I'd do this:

www.somehost.com
sub.somehost.com
213.214.15.16 *(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?

1 Answers1

0

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.

adaptr
  • 16,576
  • 23
  • 34
  • meaning I should just add a virtualhost for my specific IP/Hostname/Domainname, and it's directives I can setup the HTTP Basic Auth? –  Jan 28 '13 at 15:13
  • You should probably spend some time on [**basic virtual hosting with apache**](http://httpd.apache.org/docs/2.2/vhosts/) – 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? –  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