How can I block accessing my site with https + IP address?

[ad_1]

I have a wordpress site made in amazon lightsail, let's say it "website.com". And I don't want my site to be accessible from static IP. So I edited httpd-vhosts.conf like this:

<VirtualHost \*:80>
ServerName XXX.XXX.XXX.XXX
<Location />
Order deny,allow
Deny from all
</Location>
</VirtualHost>

But this doesn't block access when I visit site with https://XXX.XXX.XXX.XXX. What should I do to block access when I visit site with https and IP address too?

[ad_2]
1 Comment
  1. `Order Allow Deny` are deprecated. Use instead and make sure to restart apache

    `<RequireAll>`
    `Require all granted`
    `Require not ip` X.X.X.X
    `</RequireAll>`

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer