Restriction to an environment

Hello, can anyone help me with restriction of users to an environment? I’m a bit new to these stuff so pardon my ignorance :)

Here is my situation:

My test and production environment are on the same server

and lets say my urls will be as follows:

test = https://test.blabla.com

prod = https://www.blabla.com

So the situation are as follows:

  • prod will be accessed publicly (no problem here)

  • test should not be publicly accessible

  • test may have some remote users who can access it

  • those remote users doesn’t have static ip

i wanted to do this at my VirtualHost level, but i don’t know if this is possible and i don’t want to go to htaccess and htpasswd authentication

If this is not possible, can we do this at yii level? like restricting for gii using "allowedIps"? if yes, is this a good implementation???

what do you suggest me to do in my situation?

how do you guys manage your different environments?

What web server are you running? If you’re using Apache, you can do it from a VirtualHost directive: http://httpd.apache.org/docs/2.2/howto/access.html

You mention users don’t have static IPs. You’d run in to the same problems on a Yii level as a server level. You’re going to have to account for wildcards at some point, may as well implement it from the server.

Im using apache.

Could you explain how can i do this in my virtual host?