i have a payment service running in a iframe and on success it is redirected to may app with
http://localhost/payment/success
this returns a 404 error but if i use
http://localhost/
the app is shown (index.html) but i need it to be routed to payment/success. What am i doing wrong? It seams like framework7 doesnt axcept routing through url paths.
router.app.php
{
path: '/payment/success/',
async: function ({ router, to, resolve }) {
// load modules
loadF7Module(this.app, 'payment').then(() => {
// resolve route
resolve({
component: PaymentPage,
});
});
}
},
This has more to do with the server side. The server should always point to index.html, and the rule is that, Then, F7 will use the url route to “navigate” to the correct route.
For apache, You can see this .htaccess example
<Files sw.js|service-worker.js>
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</Files>
RewriteEngine On
# Redirection of requests to index.html
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -s [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^.*$ - [NC,L]
# Redirect all non-file routes to index.html
RewriteRule ^(?!.*\.).*$ index.html [NC,L]
It will depend if your server document root, this example is for apps that run on main domain.