If you want to make certain urls from a website inaccessible to other visitors, follow the steps.
Allow only certain IPS to access this url for example: incvice.com/admin.
From the config file of Apache, add this code.
Deny from all
Allow from 126.96.36.199
Allow from 188.8.131.52
All other IPS that will visit incvice.com/admin will get a restricted error message instead of the admin page.
Save the apache config file and restart apache using this command: $ service apache2 restart
Another method is to only allow the access by using authentication:
First step: Add inside apache’s config file this code:
AuthName Password Protected Area
Second step: create the htpasswd by executing this command.
$ htpasswd -cm /var/www/htpasswd/.htpasswd user
Save and restart apache by using this command: $ service apache2 restart