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 (https://example.com/#/user/123), but I'm wanting to move away from this approach in favour of real-looking URLs (https://example.com/user/123).

Where this is a single-page application, everything is served from one central place. If a user visits https://example.com and then navigates to https://example.com/foo 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 https://example.com/foo without first going via https://example.com.

Is there a way in which I can configure some form of redirect within Cloudflare to point URLs like https://example.com/foo to https://example.com 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






How to appoach links in canvas/WebGL?

Updated February 06, 2018 11:04 AM


Cache file /home/queryxchang/public_html/apps/frontend/config/../cache/-q-5-110331-can-i-configure-cloudflare-to-point-all-url-paths-to-a-specific-path-without-changing-the-url- could not be written