How to deny access to a specific view with CodeIgniter -


i deny access admin site of webpage created codeigniter.

this link www.mydomain.com/admin

i created htaccess file following code

order deny,allow deny allow xx.xxx.xxx.xxx 

i put htaccess file in application/view/admin

obviously not work. correct way deny specific folder in codeigniter project?

edit:

why not add ip check in admin class constructor?

public function __construct() {     parent::__construct();     if ($this->input->ip_address() != 'xx.xxx.xxx.xxx')     {         show_404();     }     } 

Comments