Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix website error pages #13963

Merged
merged 2 commits into from
Jan 28, 2019
Merged

Conversation

aaronmarkham
Copy link
Contributor

@aaronmarkham aaronmarkham commented Jan 23, 2019

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

  • Changed the 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.
  • Generalized the redirects for pages that should be current (thanks @ddavydenko!).
  • Deleted unnecessary artifacts (index.html was from an old workaround and is not used)
  • Created two new html error pages that don't use relative links to assets as this fails when being loaded dynamically for a 404 message.
  • Updated the Sphinx script to copy these error pages when doing a local build
  • Moved the 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 publish

Preview

Aside from the redirect test links, you can try:

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 for default_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 to master. (That's fine anyway as I can't imagine why an error page could be the latest at all times.)

</div>
<div>
<span id="page-does-not-exist"></span><h1>Page Does Not Exist</h1>
<p>If you’re here that means you requested a page that doesn’t exist. Sorry about that! Maybe try the search box to find what you’re looking for, or navigate to the <a href="https://mxnet.incubator.apache.org/index.html">Home Page</a>. Also, make sure you’re looking in the correct version, as some features may only be available in <a href="https://github.com/apache/incubator-mxnet/releases">newer versions</a> or the <a href="https://mxnet.incubator.apache.org/versions/master">master branch</a>.</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relative link maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I fixed that. Thanks.

@aaronmarkham aaronmarkham merged commit c701be5 into apache:master Jan 28, 2019
jlcontreras pushed a commit to jlcontreras/incubator-mxnet that referenced this pull request Feb 14, 2019
* fix error redirect

* add error artifacts for local build
stephenrawls pushed a commit to stephenrawls/incubator-mxnet that referenced this pull request Feb 16, 2019
* fix error redirect

* add error artifacts for local build
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
* fix error redirect

* add error artifacts for local build
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants