Akira Kurogane
Akira Kurogane
CDCloudflare Developers
Created by Akira Kurogane on 4/4/2025 in #pages-help
Can Pages do rewrites (not redirects)
Hi. I'm trying Cloudflare Pages as an alternative to Firebase hosting for my existing site. I'm having a pretty positive experience so far, especially with the build-from-git integration. But I've come to an issue which seems to block the migration. Amongst some of the routes my static site uses I have ones that have a pattern such as /ws/<wsid>/viewtypexxx, which I would like to be rewritten as /ws/viewtypexxx.html. By "rewritten" I mean the httpd server serves the content of the latter when the client requests the former. The JS in my page parses the wsid value out of the location for itself so the right content is loaded dynamically after initial page load. I'm not finding any solution in docs, but it doesn't say clearly that it isn't supported either, and rewrite rules seem common enough these days in other hosting I've been uisng over the last couple of years. Are they supported?
15 replies