Closed wilhelmer closed 3 years ago
When the HTML output files are accessed locally (file:// protocol), the redirects don't work.
This is because of the leading slash in the redirect target.
Tested in Firefox and Chrome.
use_directory_urls: false plugins: - redirects: redirect_maps: 'old.md': 'new.md'
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Redirecting...</title> <link rel="canonical" href="/new.html"> <meta name="robots" content="noindex"> <script>var anchor = window.location.hash.substr(1); location.href = "/new.html" + (anchor ? "#" + anchor : "")</script> <meta http-equiv="refresh" content="0; url=/new.html"> </head> <body> Redirecting... </body> </html>
If I manually replace /new.html by new.html, everything works fine, both locally and on the web, and both in Chrome and Firefox.
When the HTML output files are accessed locally (file:// protocol), the redirects don't work.
This is because of the leading slash in the redirect target.
Tested in Firefox and Chrome.
mkdocs.yml
old.html
Solution
If I manually replace /new.html by new.html, everything works fine, both locally and on the web, and both in Chrome and Firefox.