I built an image randomizer so that when I open a .php file in a URL that it displays the image with readfile($randomImage);
. This works locally but when I upload it to the server it gets blocked by the firewall since we do not want to be able to load URLs like
https://www.example.com/wp-content/themes/THEME/randomImage.php
I want to load a .php
script on a .jpg
file.
What needs to happen is that when I use the URL (for instance)
https://www.example.com/image.jpg
and when I load this image that it runs a PHP file like
https://www.example.com/randomizer.php
In other words, I want WordPress to think that it is loading a URL ending with .jpg
but opens a .php
file
Is this something that is realizable?