Can I configure Cloudflare to point all URL paths to a specific path without changing the URL?

by James Donnelly   Last Updated October 27, 2017 10:04 AM

I have a single page application which is hosted on GitHub Pages. Currently the application uses a URL hash to imitate different paths (, but I'm wanting to move away from this approach in favour of real-looking URLs (

Where this is a single-page application, everything is served from one central place. If a user visits and then navigates to the SPA logic will prevent the page from actually changing, whilst realising that the user wanted to go to /foo.

The problem I'm having is that this logic doesn't apply if the user navigates directly to without first going via

Is there a way in which I can configure some form of redirect within Cloudflare to point URLs like to without making any changes to the URL?

Although it's probably obvious anyway, creating a separate index.html file to serve files in a /foo folder isn't an option as some of the paths are dynamically generated (i.e. /company/123/user/456).

Related Questions