This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #13959
This PR creates new error pages, uses some better regex's in the
.htaccess
file, and it provides better artifact handling for the build process.Changes
ErrorDocument
for 404 errors to a local file instead of using a hard-coded link to the error page in production. This is partly why we ended up with a redirect loop. It also had the drawback of giving a 302 redirect header instead of 404. Bots 🤖 don't like that, plus it was probably fooling the broken link checker.mxnet.css
artifact copy to the Sphinx script function to better consolidate artifact and build updates; also this help make sure that any updates to css in your dev version will get applied during a local build AND a full website publishPreview
Aside from the redirect test links, you can try:
🌮 Break things with a random URL like: http://34.201.8.176/versions/local_error/tacos
❓ Look for an API doc that doesn't exist, like Clojure for v0.11.0: http://34.201.8.176/versions/0.11.0/api/clojure/index.html
Note that I redirect 🌮 requests or anything really in an API subfolder's that is designated in the .htaccess file to the API error, rather than the 404 error. This way we can say, well, maybe it does exist, so try a different version.
Comments
Unfortunately, for some reason
ErrorDocument
converts the environment variable fordefault_version
just fine, but then just outputs the URL as text to the browser rather that forcing a redirect. So it has to stay hard-coded tomaster
. (That's fine anyway as I can't imagine why an error page could be the latest at all times.)