SchabanBo/qlevar_router

This XML file does not appear to have any style information associated with it

ajaylg opened this issue · 9 comments

I used the url_strategy flutter package to remove /#/ from the web URL and define routes for pages as per your package example
and hosted to AWS S3 it's working fine as per your Solution in #9 but when I refresh the URL from any page it shows access denied
Capture

Hi @ajaylg
This is not something from the package. you need to configure your server to redirect all unknown pages to index.html so flutter can handle the URL.
to do so you need to create a .htaccess file in the same folder where you index.html file is and add the flowing in it:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>

BTW: you can remove the hashtag from the URL using

void main() {
  QR.setUrlStrategy();
  runApp(MyApp());
}

I created .htaccess file and imported the above code you provided but nothing happens shows same result as mentioned above
#10

I used this code

RewriteEngine On
RewriteBase /
RewriteRule ^index.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]

I had the same problem with the example website and another website on two different hosting serivce and it was solved with this.
Maybe you need to do something in azure settings,

Can you Provide Some Detail information about S3 hosting
How you solved this issue during S3 hosting
@SchabanBo

@ajaylg
unfortunately, I don't know, I didn't use S3 before.
I tried this method here and it seems, it works fine

Hi @SchabanBo

when i deploy build file in netlify . it works all routings are works, once i refresh the page. it gives the 404 page not found!

can you please help me out from this issue

Hi @guruprakashIT ,
As I know the redirect in netlify is a little bit different. See here
I didn't try it. but you need to redirect all the requests to the index.html file

I solved

Hi @SchabanBo

when i deploy build file in netlify . it works all routings are works, once i refresh the page. it gives the 404 page not found!

can you please help me out from this issue

I Solved this issue in AWS S3 Static web hosting by simply adding index.html in error document field like this
@guruprakashIT
@SchabanBo
Capture

I don't no this is the right solution, but it works in my case
@guruprakashIT