Mobile app version of vmapp.org
Login or Join
Shelley277

: Can I configure Cloudflare to point all URL paths to a specific path without changing the URL? I have a single page application which is hosted on GitHub Pages, meaning I have no access to

@Shelley277

Posted in: #Cloudflare #Github #Javascript #SinglePageApplication

I have a single page application which is hosted on GitHub Pages, meaning I have no access to any form of server configuration (like a .htaccess file).

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 example.com and then navigates to 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 example.com/foo without first going via example.com.
Is there a way in which I can configure some form of redirect within Cloudflare to point URLs like example.com/foo to 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).

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelley277

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme