Closed guilherme-diniz closed 1 year ago
Actually, it is a limitation from the browser and not a Problem from the package. See this Here the same thing is happening when you reload the page, without the hashtag, you are requesting the file in the path /home/coffee, which doesn't exist. As you see here, the browser is requesting the /home/main.dart.js
@guilherme-diniz The solution is to make all unknown requests go to the index.html file (just like the setup in SPA sites).
Below are sample configurations for Apache & Nginx servers:
Apache:
<VirtualHost *:80>
ServerName mydomainname.in
DirectoryIndex index.html
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Location / >
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.html [L]
</Location>
</VirtualHost>
Nginx:
server {
server_name mydomainname.in;
index index.html;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html;
}
}
If I set the UrlStrategy (using
QR.setUrlStrategy
) and create a Nested Navigator, when I refresh the page I get a blank screen. If I remove thesetUrlStrategy
, everything works out.With setUrlStrategy
Without setUrlStrategy