Need help in changing URL on workers proxy

HI dear,

I need simple help in changing the URL path onto the workers’ reserve proxy. I m not good at coding. The reserve proxy can change URL with several site but it’s not changing URLs with the pages using html.

Here is my simple reserve proxy code

addEventListener(“fetch”, event => {
let url = new URL(event.request.url);
url.hostname = “redi1.soccerstreams.net”; //change this
let request = new Request(url, event.request);
event.respondWith(
fetch(request, {
headers: {
‘Referer’: ‘https://redi1.soccerstreams.net’, //and this for referer
‘User-Agent’: ‘Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36’ //change this with your UA
}
})
);
});
async function handleRequest(event, url) {
// Change URL from public URL to use the origin URL
var originUrl = url.toString().replace(
‘https://’ + DOMAIN + ‘/’ + PROXYPATH,
‘https://’ + ORIGIN
);
event.passThroughOnException();
event.respondWith(fetch(originUrl));
}

Please check my worker: https://sparkling-poetry-febc.fortnite22sharma.workers.dev/

This one with the forum and it’s not hiding the original URL like https://www.desirulez.cc/forumdisplay.php/7-Suggestions

https://sparkling-poetry-febc.fortnite22sharma.workers.dev/forumdisplay.php/7-Suggestions

on other simple bootstrap sites, it’s working fine

My other worker https://proud-darkness-aa15.fortnite22sharma.workers.dev/event/etoile-de-kivu-simba-live-stream/753494

all the URL changes that are not using.html extension.

I am using the same code for both.

Please suggest to me how do I force reserve proxy to change all the URLs and with PHP, Html, and images.

Another question can i use google adsense on to the worker reserve proxy.