diff --git a/docs/_static/js/docversion.js b/docs/_static/js/docversion.js index c1bd2e331a0d..320179854448 100644 --- a/docs/_static/js/docversion.js +++ b/docs/_static/js/docversion.js @@ -22,8 +22,6 @@ function setVersion(anchor){ if (arguments.length==0) { anchor = window.location.hash }; - console.log('anchor: ', anchor, arguments.length, window.location.hash, window.location.search); - //let doc = window.location.pathname.match(/^\/(api\/.*)$/) || window.location.pathname.match(/^\/versions\/[^*]+\/(api\/.*)$/); let doc = window.location.pathname.match(/^\/versions\/[^\/]+\/([^*]+.*)$/); if (doc) { if (document.getElementById('dropdown-menu-position-anchor-version')) { @@ -31,10 +29,8 @@ function setVersion(anchor){ $(versionNav).each( function( index, el ) { currLink = $( el ).attr('href'); version = currLink.match(/\/versions\/([^\/]+)\//); - console.log(version); if (version) { versionedDoc = '/versions/' + version[1] + '/' + doc[1] + (anchor || '') + (window.location.search || ''); - console.log(versionedDoc); $( el ).attr('href', versionedDoc); } }); diff --git a/docs/build_version_doc/artifacts/.htaccess b/docs/build_version_doc/artifacts/.htaccess index 6bf3a659ce55..798fe92a0733 100644 --- a/docs/build_version_doc/artifacts/.htaccess +++ b/docs/build_version_doc/artifacts/.htaccess @@ -4,15 +4,11 @@ RewriteRule ^get_started/why_mxnet.html$ %{ENV:default_version}/faq/why_mxnet.ht RewriteRule ^get_started.*$ %{ENV:default_version}/install/ [R=301,L] RewriteRule ^how_to.*$ %{ENV:default_version}/faq/ [R=301,L] RewriteRule ^api/python/symbol.html$ %{ENV:default_version}/api/python/symbol/symbol.html [R=301,L] -RewriteRule ^community/index.html$ %{ENV:default_version}/community/contribute.html [R=301,L] +RewriteRule ^(?:versions\/[^\/]+\/)?community/index.html$ %{ENV:default_version}/community/contribute.html [R=301,L] # Navigation bar redirects to latest info -RewriteRule ^versions\/[0-9.]+\/architecture/(.*)$ %{ENV:default_version}/architecture/$1 [R=301,L] -RewriteRule ^versions\/[0-9.]+\/community/(.*)$ %{ENV:default_version}/community/$1 [R=301,L] -RewriteRule ^versions\/[0-9.]+\/faq/(.*)$ %{ENV:default_version}/faq/$1 [R=301,L] -RewriteRule ^versions\/[0-9.]+\/gluon/(.*)$ %{ENV:default_version}/gluon/$1 [R=301,L] -RewriteRule ^versions\/[0-9.]+\/install/(.*)$ %{ENV:default_version}/install/$1 [R=301,L] -RewriteRule ^versions\/[0-9.]+\/tutorials/(.*)$ %{ENV:default_version}/tutorials/$1 [R=301,L] +RewriteCond %{ENV:default_version}#\/$1 !^([^#]+)#\1$ +RewriteRule ^(versions\/[^\/]+)?(?:\/)?(faq|community|install|gluon|tutorials|architecture)(.*)?$ %{ENV:default_version}/$2$3 [R=301,L] # Redirect navbar APIs that did not exist RewriteRule ^versions/0.11.0/api/python/contrib/onnx.html %{ENV:default_version}/error/api.html [R=301,L]