How to allow access to a yii web application for specific users using .htaccess
-
I am using yii2 basic application template and developed an application.
I am using VPS server for hosting this application on a domain on Host gator.Now I want that only office users should access this application i.e, (while accessing this application using domain, .htaccess file should check if the IP accessing this domain is allowed to have access. If yes, then that IP should be able to have access, else that IP should see a message containing Access Denied).
If we do this then how to specify IP addresses in .htaccess file. Do we need to specify the static IP addresses of the employees in our organization?
If we write the foll code in .htaccess,
order allow,deny
allow 192.168.1.3
deny from allHere, which IP address to be specified? Do we need to specify the Public IP or routers Private IP or static IP?
How to accomplish this?
Does IP address change from network to network. When I connect to my WiFi, i get my public IP. So this IP is unique in the world?