Open Techs4gnu opened 10 months ago
Hey @Techs4gnu
Because it's a SPA. So to fix your issue, you basically just need to tell your web server to handle 404
errors by responding with a 200
and serving up index.html
. (Don't worry, all 404 and client error will be handled by web-check already)
If you could let me know what web server your using, and I can help you update your config file. But here's how I've gotten similar things working with various web servers and static hosting providers....
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
{
"rewrites": [
{ "source": "/(.*)", "destination": "/index.html" }
]
}
location / {
try_files $uri /index.html;
}
url.rewrite-if-not-file = ("(.*)" => "/index.html")
http:
middlewares:
spa-rewrite:
replacePathRegex:
regex: "^/.+"
replacement: "/index.html"
FallbackResource /index.html
(it's been a while since I've written one of these, so double-check it before running!)
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.html [L]
Deployed the web check on https://webcheck.mydevelopmentpro.com. But the results generated are not available when trying to refresh the page.
What could be the issue?