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 22.214.171.124
Allow from 126.96.36.199
Be sure to add your IP, you can find what is your IP on the Internet.
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:
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.