Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path-based routing needed for SEO and clean URLs #51

Open
ScraM-Team opened this issue Aug 17, 2020 · 0 comments
Open

Path-based routing needed for SEO and clean URLs #51

ScraM-Team opened this issue Aug 17, 2020 · 0 comments

Comments

@ScraM-Team
Copy link
Contributor

ScraM-Team commented Aug 17, 2020

Flavour currently uses hash-based routing, which works great for many cases. For a path like "/buttons", the URL looks like:

https://frequal.com/tea-sampler/#/buttons

However, it would be great to have an option to use path-based routing. For the same "/buttons" path, a path-based URL would look like this:

https://frequal.com/tea-sampler/buttons

For some Flavour apps path-based routing is preferred for these reasons:

  • Google does not index hash-based links, rendering most Flavour pages invisible to Google
  • Some users prefer URLs that are more 'readable'
  • Google Analytics tracks path-based routes by default, and ignores hash-based routes

For developers, path-based routing should be easy to enable. Ideally it would be as easy as:

Routing.usePathStrategy();

For direct URLs to work, there may be a need to set the base URL in index.html:

<base href="https://frequal.com/tea-sampler/" />

web.xml will also need to redirect to index.html:

<error-page> <location>/index.html</location> </error-page>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant