Skip to content

[infra] Configure web server to use HTTP 301 for redirects #66

Description

@rnk

The Clang and LLVM documentation contains several placeholder files whose only purpose is to ensure that old links don't die. However, HTTP meta refresh headers are super clunky, the reading experience is terrible, and it makes renaming documentation very costly, because you can never delete a file.

It would be very helpful if our web server (today, Apache, tomorrow, who knows) had some redirect configuration drop-in functionality. Google AIO suggested something like this for Apache:

# Include all project-specific redirect configs automatically
IncludeOptional /etc/httpd/conf.d/sphnx-redirects/*.conf

You can imagine maintaining a list of redirects in llvm/docs/redirects.toml or something like that, processing it (let's not store raw web server config in llvm-project), pushing the generated .conf file into the appropriate config directory, and hot reloading the server config whenever it changes.

This would allow us to GC dead documentation files, especially in clang-tidy, which documents every check in a single doc file:

❯ rg http-equiv=refresh clang-tools-extra/docs | wc -l
110

cc @petrhosek @asl , WDYT, viable, worth it?

Maybe we have enough on our plate getting Terraform going in AWS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    infra-area-teamFor tracking infra area team tasks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions