apache / arrow-site

Mirror of Apache Arrow site
Apache License 2.0
31 stars 106 forks source link

[Website]: Redirect existing docs from https://arrow.apache.org/ to https://datafusion.apache.org/ #502

Closed alamb closed 2 months ago

alamb commented 2 months ago

Closes https://github.com/apache/datafusion/issues/10194 Closes https://github.com/apache/datafusion/issues/10124

Rationale

We would like to redirect existing datafusion pages / links to the new website on https://datafusion.apache.org/ https://github.com/apache/datafusion/issues/10194 for more rationale

Changes

  1. Add a jekyll plugin for redirects
  2. Add static pages for each existing static page

Testing locally when you navigate to the DataFusion link it correctly redirects

Screenshot 2024-04-23 at 7 40 29 AM

http://localhost:4000/datafusion redirects to https://datafusion.apache.org/

Testing

I tested manually

https://arrow.apache.org/datafusion/user-guide/introduction.html Changed to http://localhost:4000/datafusion/user-guide/introduction.html Redirects to https://datafusion.apache.org/user-guide/introduction.html

https://arrow.apache.org/datafusion/library-user-guide/working-with-exprs.html changed to http://localhost:4000/datafusion/library-user-guide/working-with-exprs.html redirects to https://datafusion.apache.org/library-user-guide/working-with-exprs.html

I also checked the url from https://github.com/apache/datafusion/issues/10124

https://arrow.apache.org/datafusion/user-guide/cli.html Changed to http://localhost:4000/datafusion/user-guide/cli.html Redirects to https://datafusion.apache.org/user-guide/cli/index.html

https://arrow.apache.org/datafusion/user-guide/cli/index.html Changed to http://localhost:4000/datafusion/user-guide/cli/index.html Redirects to https://arrow.apache.org/datafusion/user-guide/cli/index.html

kou commented 2 months ago

It seems that we can use .htaccess: https://infra.apache.org/project-site.html (See the "Custom website directives using .htaccess files" section)

How about trying .htaccess?

diff --git a/.htaccess b/.htaccess
new file mode 100644
index 00000000000..e19ec2a4fbd
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,16 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+Redirect permanent /datafusion/ https://datafusion.apache.org/
alamb commented 2 months ago

How about trying .htaccess?

Thanks @kou -- I will give it a try