'Configure Apache to restrict a page to a subnet

I am trying to configure an Apache Server version 2.4 to restrict external users from accessing some pages.

I have something looking like that but it is not very concluent since the page if forbidden for everybody:

<Directory /var/www/html/folder>
    <Files *.php>
            Require ip x.x.x.x/24
    </Files>
</Directory>

I tried other syntaxes for subnets (x.x.x, x.x.x.0 ...) nothing seemed to work

What's the correct way to do this ? Thank you



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source