From 0de48606a62df04452cdafb2b785c97411d04827 Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Thu, 16 Jul 2020 12:45:11 -0700 Subject: [PATCH 1/6] set website default version - test redirect --- docs/static_site/src/.htaccess | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/static_site/src/.htaccess b/docs/static_site/src/.htaccess index 2cf7300946be..40531bf4e44f 100644 --- a/docs/static_site/src/.htaccess +++ b/docs/static_site/src/.htaccess @@ -22,6 +22,14 @@ RewriteOptions AllowNoSlash +# Set default website version to current stable (v1.6) TODO delete test code and uncomment origin code +RewriteCond %{REQUEST_URI} ^/versions/1.1.0/community/contribute.html$ +# RewriteCond %{REQUEST_URI} ^/$ +RewriteCond %{HTTP_REFERER} !mxnet.apache.org +RewriteCond %{HTTP_REFERER} !mxnet.incubator.apache.org +Rewriterule ^(.*)$ /versions/1.6/community/contribute.html [r=307,L] +# Rewriterule ^(.*)$ /versions/1.6/ [r=307,L] + # TODO temporary fix for issue #18604 Redirect 302 /api/r/docs/api/R-package/build/mxnet-r-reference-manual.pdf https://mxnet-public.s3.us-east-2.amazonaws.com/docs/v1.x/mxnet-r-reference-manual.pdf Redirect 302 /api/scala/docs/api/ /versions/1.6/api/scala/docs/api/ From f419d808854842721bacf24bebf496d841d3618c Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Sun, 19 Jul 2020 16:43:58 -0700 Subject: [PATCH 2/6] enable first time redirect on all master website pages --- docs/static_site/src/.htaccess | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/static_site/src/.htaccess b/docs/static_site/src/.htaccess index 40531bf4e44f..813cd17a19ca 100644 --- a/docs/static_site/src/.htaccess +++ b/docs/static_site/src/.htaccess @@ -24,11 +24,11 @@ RewriteOptions AllowNoSlash # Set default website version to current stable (v1.6) TODO delete test code and uncomment origin code RewriteCond %{REQUEST_URI} ^/versions/1.1.0/community/contribute.html$ -# RewriteCond %{REQUEST_URI} ^/$ +# RewriteCond %{REQUEST_URI} !^/versions/ RewriteCond %{HTTP_REFERER} !mxnet.apache.org RewriteCond %{HTTP_REFERER} !mxnet.incubator.apache.org Rewriterule ^(.*)$ /versions/1.6/community/contribute.html [r=307,L] -# Rewriterule ^(.*)$ /versions/1.6/ [r=307,L] +# Rewriterule ^(.*)$ /versions/1.6/$1 [r=307,L] # TODO temporary fix for issue #18604 Redirect 302 /api/r/docs/api/R-package/build/mxnet-r-reference-manual.pdf https://mxnet-public.s3.us-east-2.amazonaws.com/docs/v1.x/mxnet-r-reference-manual.pdf From d354a65c6ca939076cae897b90c5bfb41666ed28 Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Sun, 19 Jul 2020 16:46:34 -0700 Subject: [PATCH 3/6] update test code --- docs/static_site/src/.htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/static_site/src/.htaccess b/docs/static_site/src/.htaccess index 813cd17a19ca..9cac2b012ff6 100644 --- a/docs/static_site/src/.htaccess +++ b/docs/static_site/src/.htaccess @@ -27,7 +27,7 @@ RewriteCond %{REQUEST_URI} ^/versions/1.1.0/community/contribute.html$ # RewriteCond %{REQUEST_URI} !^/versions/ RewriteCond %{HTTP_REFERER} !mxnet.apache.org RewriteCond %{HTTP_REFERER} !mxnet.incubator.apache.org -Rewriterule ^(.*)$ /versions/1.6/community/contribute.html [r=307,L] +Rewriterule ^(.*)$ /versions/1.6/$1 [r=307,L] # Rewriterule ^(.*)$ /versions/1.6/$1 [r=307,L] # TODO temporary fix for issue #18604 From e03af4f4eb1f2219c8282c0979edfe55f465bc2c Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Sun, 19 Jul 2020 16:47:36 -0700 Subject: [PATCH 4/6] remove unnecessary test code --- docs/static_site/src/.htaccess | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/static_site/src/.htaccess b/docs/static_site/src/.htaccess index 9cac2b012ff6..00f0b5f75eae 100644 --- a/docs/static_site/src/.htaccess +++ b/docs/static_site/src/.htaccess @@ -28,7 +28,6 @@ RewriteCond %{REQUEST_URI} ^/versions/1.1.0/community/contribute.html$ RewriteCond %{HTTP_REFERER} !mxnet.apache.org RewriteCond %{HTTP_REFERER} !mxnet.incubator.apache.org Rewriterule ^(.*)$ /versions/1.6/$1 [r=307,L] -# Rewriterule ^(.*)$ /versions/1.6/$1 [r=307,L] # TODO temporary fix for issue #18604 Redirect 302 /api/r/docs/api/R-package/build/mxnet-r-reference-manual.pdf https://mxnet-public.s3.us-east-2.amazonaws.com/docs/v1.x/mxnet-r-reference-manual.pdf From 45705b14485de2ed9499bfe304ec11a69c6c6895 Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Wed, 22 Jul 2020 10:20:42 -0700 Subject: [PATCH 5/6] fix typo --- docs/static_site/src/.htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/static_site/src/.htaccess b/docs/static_site/src/.htaccess index 00f0b5f75eae..22fc63d656fb 100644 --- a/docs/static_site/src/.htaccess +++ b/docs/static_site/src/.htaccess @@ -27,7 +27,7 @@ RewriteCond %{REQUEST_URI} ^/versions/1.1.0/community/contribute.html$ # RewriteCond %{REQUEST_URI} !^/versions/ RewriteCond %{HTTP_REFERER} !mxnet.apache.org RewriteCond %{HTTP_REFERER} !mxnet.incubator.apache.org -Rewriterule ^(.*)$ /versions/1.6/$1 [r=307,L] +RewriteRule ^(.*)$ /versions/1.6/$1 [r=307,L] # TODO temporary fix for issue #18604 Redirect 302 /api/r/docs/api/R-package/build/mxnet-r-reference-manual.pdf https://mxnet-public.s3.us-east-2.amazonaws.com/docs/v1.x/mxnet-r-reference-manual.pdf From 76029f648315f4191c06192ac503e5e7fa0cb561 Mon Sep 17 00:00:00 2001 From: Yang Shi Date: Wed, 22 Jul 2020 15:28:58 -0700 Subject: [PATCH 6/6] delete test code --- docs/static_site/src/.htaccess | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/static_site/src/.htaccess b/docs/static_site/src/.htaccess index 22fc63d656fb..dabc51a41f2b 100644 --- a/docs/static_site/src/.htaccess +++ b/docs/static_site/src/.htaccess @@ -22,9 +22,8 @@ RewriteOptions AllowNoSlash -# Set default website version to current stable (v1.6) TODO delete test code and uncomment origin code -RewriteCond %{REQUEST_URI} ^/versions/1.1.0/community/contribute.html$ -# RewriteCond %{REQUEST_URI} !^/versions/ +# Set default website version to current stable (v1.6) +RewriteCond %{REQUEST_URI} !^/versions/ RewriteCond %{HTTP_REFERER} !mxnet.apache.org RewriteCond %{HTTP_REFERER} !mxnet.incubator.apache.org RewriteRule ^(.*)$ /versions/1.6/$1 [r=307,L]