Hello,
does anyone know how to open a specific page of a Framework7 web application directly via a standard web link?
For example:
https://mywebapp.xyz/#/legalconditions
https://mywebapp.xyz/legalconditions
I’m working on an web application where, after a button is clicked, the user should be redirected to my F7 web app at the specific page /legalconditions/
I tried all combinations by varying the following parameters, but none of them worked.
- pushState:true/false ; (see modifications below )
- route: component, componentUrl, url ; (see modifications below )
- server settings with and without ; (see modifications below )
- browser link options: https://www.mywebapp.com/#/legalconditions/ and https://www.mywebapp.com/legalconditions/
Does anyone know how to do it properly?
---- Modification in app.js file : ---------
var app = new Framework7({
name: ‘VedoVado’, // App name
theme: ‘auto’, // Automatic theme detection
el: ‘#app’, // App root element
component: App, // App main component
view: {
pushState: true, // enables history API routing. [true/false]
pushStateRoot: ‘/’, // base path of your app
},
// App routes
routes: routes,
});
export { app }
----------- Modification in routes.js: -----------------------
var routes = [
{
path: ‘/’,
component: HomePage,
},
…
…
{
path: ‘/legalconditions/’,
component: pagelegalconditions,
// componentUrl: ‘./pages/legalconditions.f7’, // test 1: internal appweb menu links do not properly work
// url: ‘./pages/legalconditions.f7’, // test 2: ,internal appweb menu links in do not properly work
},
{
path: ‘(.*)’,
component: NotFoundPage,
},
];
-------- modifications in server .htaccess file: --------------------
RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !-f [OR] commented since error in webapp on fetching data
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^ - [L]
Redirect everything else to index.html
RewriteRule ^ index.html [L]