I am creating a simple PHP web proxy. The PHP script currently correctly fetches the page's HTML from the backend.
However clearly this is not enough since all the resources (img, script, link, a) all point to relative or absolute links e,g example.com/image.png which makes it load directly.
What would be an easy way to "proxify" all these resources to pass through, e.g example.com/image.png
would be /proxy/resource.php?r=example.com/image.php
or something.
If anyone knows a good way to do this I'd be delighted to know it.