I've added this in the .htaccess
the file located in the root of the project:
<Files *.php>
Require host lamtakam.test lamtakam.com
Require ip ::1 95.216.xx.xx
</Files>
I've used xx.xx
to keep my real ip hidden in a public community, in reality, there are numbers instead of x
s.
Now I need to call a file daily (using a cron job crontab
) from the same server, something like this:
0 22 * * * wget /path/to/file.php
But I get this error:
--2020-09-13 13:33:55-- https://lamtakam.com/path/to/file.php
Resolving lamtakam.com (lamtakam.com)... 104.31.74.192, 172.67.174.239, 104.31.75.192, ...
Connecting to lamtakam.com (lamtakam.com)|104.31.74.192|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2020-09-13 13:33:55 ERROR 403: Forbidden.
Note: I use Cloudflare and these IPs belongs to it: 104.31.74.192, 172.67.174.239, 104.31.75.192
Any idea how can I make file.php
accessible when I can it from the same server? (And not from anywhere else)