Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omitting trailing slashes redirects to broken pages without CSS #40

Open
not-my-profile opened this issue Jan 14, 2022 · 2 comments
Open

Comments

@not-my-profile
Copy link

https://thanks.rust-lang.org/rust/all-time/ -> works
https://thanks.rust-lang.org/rust/all-time -> redirects to https://rust-lang.github.io/thanks/rust/all-time/ which has broken CSS

https://thanks.rust-lang.org/rust/1.59.0/ -> works
https://thanks.rust-lang.org/rust/1.59.0 -> redirects to https://rust-lang.github.io/thanks/rust/1.59.0/ which has broken CSS

etc.

@JohnTitor
Copy link
Member

There are two issues:

  • redirecting is broken: When we access to /fooDir on GitHub Pages, it tries to redirect to /fooDir/. However, our custom domain isn't configured on GitHub Pages but cloudfront, it will redirect to rust-lang.github.io/thanks/fooDir/.
  • style is broken: because we use an absolute path and on GitHub Pages domain it will result in 404.

One easy fix is to manage everything on GitHub Pages, I think.

@Mark-Simulacrum
Copy link
Member

We need cloudfront (or needed) because we want to set some custom headers in responses (e.g., to prevent script injection); I don't know the extent to which that's still necessary, but it was the original rationale.

In terms of the redirects breaking, that makes sense. I think one possibly easy fix is to tell GitHub pages they're on a custom domain (thanks.internal.rust-lang.org) and then maybe that'll fix things in terms of not being relative? Not sure. Maybe something we could intercept at cloudfront layer too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants