athomas
athomas
CDCloudflare Developers
Created by athomas on 11/12/2024 in #pages-help
redirects not working with trailing slash inputs
I have an astro site hosted on cloudflare pages. The url scheme changed recently to move blog posts from the root to their own blog subdirectory (http://example.com/post -> http://example.com/blog/post). As such, I'm trying to set up redirects from the old post urls to the new ones, but unfortunately, the redirects are not working for inputs which have a trailing slash. For example, example.com/post will redirect to example.com/blog/post, but example.com/post/ will not. I've tried both astro's configureable redirects as well as the _redirects page for pages, but no luck. Does anyone have thoughts on how I might solve this?
1 replies
CDCloudflare Developers
Created by athomas on 10/24/2023 in #workers-help
workers types issue with Response
trying to make a simple websocket server with durable objects, passing the websocket as a ResponseInit parameter was causing issues, so I imported the types for DurableObject, Request, and Response from '@cloudflare/workers-types/experimental', that makes the typescript error go away, but when I try to run or deploy I get the following error: No matching export in "node_modules/@cloudflare/workers-types/experimental/index.ts" for import "Response", but the file clearly exports a Response class, any ideas?
4 replies