If you do not want your website to be accessed by typing your static IP address on the server, just add the following lines to the .htaccess that you create in the root directory:
9 8 7 6 Change your IP address
RewriteEngine On RewriteCond %{HTTP_HOST} ^9\.8\.7\.6$ RewriteRule .* - [F,L]
This will allow you to access your website in the form http://www.example.com, while accessing the http://9.8.7.6 method will be prohibited.