diff --git a/docs/tools/build.py b/docs/tools/build.py index 5649d176296..bc5944dd9a2 100755 --- a/docs/tools/build.py +++ b/docs/tools/build.py @@ -332,7 +332,7 @@ def build_redirect_html(args, from_path, to_path): from_path.replace('/index.md', '/index.html').replace('.md', '/index.html') ) version_prefix = f'/{args.version_prefix}/' if args.version_prefix else '/' - target_path = to_path.replace('.md', '/') + target_path = to_path.replace('/index.md', '/').replace('.md', '/') to_url = f'/docs{version_prefix}{lang}/{target_path}' to_url = to_url.strip() write_redirect_html(out_path, to_url)