In a nutshell, I work on local folders for pre-release site testing. My live site (domain.com) is always pointed to a folder named AALIVE, while my #1 test site (test.domain.com) points to AATEST1. When testing is complete I have a script that renames AALIVE->OLDx, and AATEST1->AALIVE, effectively setting the test site as live while maintaining the old site in case I have to revert.
I just realized that google has indexed my test domains, which I am trying to stop. My thought was to identify whether the folder was being accessed from domain.com or test.domain.com, and allow only my ip for the test site.
I am open to suggestions to help sort this out... any thoughts will be greatly appreciated!
After much research I think I need to use something like the following:
SetEnvIf HOST ^*test.*$ HOST_TEST
<IfDefine HOST_TEST> AuthUserFile … </IfDefine>
This should set the environment variable HOST_TEST if the subdomain consists of test, then require authentication. However, I'm sure I have something wrong as I'm getting an internal server error, and would appreciate a second set of eyes.