Search code examples
javascripturl-rewritinghybrid-mobile-apphtml-framework-7

How to rewrite URL in Framework7?


I noticed that Framework7's url is like this

https://domain.com/signup.html#!/#geolocation

Is there any way to make the urls cleaner if I'm looking at it as webapp and mobile app.

I can't see any documentation how to handle urls for webapps. I might have missed it or it's not documented.

Thanks!


Solution

  • in order to have a cleaner look and depending by your needs you can:

    1. choose an appropriate pushStateSeparator during app initialization.

      var myApp = new Framework7({
      pushState: true,
      pushStateSeparator: '#page/',
      // ... other parameters
      });
      
    2. disable router and manage this by your own.

      var myApp = new Framework7({
      router: false,
      // ... other parameters
      });
      

    More on this in each parameter description on F7 Documentation.