Say I've got a htaccess file shared by "dev.server" and "".

The very first domain should allow all customers to gain access to it unchallenged (it only is available on my small local development server).

The 2nd domain I wish to authenticate customers with Apache (NOT by database).

The code to authenticate customers is:

AuthType Basic
AuthName "Server Admin"
AuthUserFile "/path/to/passwd"
require valid-user

Things I can't do is make individuals 4 lines only matter when the domain is "". How do i do that?

I looked for something similar to <IfEnv HTTP_HOST ""> but didn't have luck.

This seems to operate, still have to do some testing onto it though.

Order Deny,Allow
Deny from all

SetEnvIf Host dev
Allow from env=dev

AuthUserFile .pwd
AuthType Basic
AuthName MySite
Require valid-user
Satisfy Any

So far as I understand, this can not be completed in a .htaccess file. You'd need to put this right into a [cde] or [cde] section, each of which can not be utilized in a Directory file.

You would need to define it in 2 separate files, or directly within the server's configuration within the VirtualHost section.