Catt0s
Catt0s
CDCloudflare Developers
Created by Catt0s on 8/8/2023 in #general-help
URL Rewrite to remove file extension
Hi, Can someone help me make a URL rewrite expression that removes file extension? Example: URI path in: /aaa/bbb.png URI out: /aaa/bbb (which shows bbb.html) The tricky thing is I don't have the premium stuff like regex
15 replies
CDCloudflare Developers
Created by Catt0s on 7/7/2023 in #pages-help
MIME type issues with functions?
Refused to execute script from 'https://example.com/myfunction.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. CODE:
<!DOCTYPE html>
<html>
<head>
<script src="./myfunction.js"</script>
</head>
<body>
<button onclick="bodyTest()">TEST</button>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script src="./myfunction.js"</script>
</head>
<body>
<button onclick="bodyTest()">TEST</button>
</body>
</html>
function bodyTest(){
return("hello, world!");
}
function bodyTest(){
return("hello, world!");
}
I am not exactly sure what I am doing wrong..
15 replies
CDCloudflare Developers
Created by Catt0s on 6/19/2023 in #pages-help
Interacting with D1 database with URL query
Hello, I want to build my pages website to show page contents based on the URL query. I made a D1 database and a function. But I am inexperienced with this stuff, and would like help. I know that functions run server-size, and therefore cannot get the window for the URL parameters, how else can I do this?
16 replies