cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject [cassandra-website] 01/01: Redirect old in-tree docs to include the /cassandra/ section in the URL
Date Tue, 03 Aug 2021 19:28:00 GMT
This is an automated email from the ASF dual-hosted git repository.

mck pushed a commit to branch asf-staging
in repository https://gitbox.apache.org/repos/asf/cassandra-website.git

commit 58533ee0475e4300a904869392ec86f8878f52cd
Author: mck <mck@apache.org>
AuthorDate: Tue Aug 3 21:23:42 2021 +0200

    Redirect old in-tree docs to include the /cassandra/ section in the URL
---
 content/.htaccess | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/content/.htaccess b/content/.htaccess
index c87afe0..8004f14 100755
--- a/content/.htaccess
+++ b/content/.htaccess
@@ -1,17 +1,19 @@
-RewriteEngine On
+<IfModule mod_rewrite.c>
+    RewriteEngine On
 
-RewriteCond %{HTTPS} !=on
-RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
+    # always https
+    RewriteCond %{HTTPS} !=on
+    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
 
-RedirectMatch 301 "^/$" "/_/index.html"
+    # frontpage
+    RedirectMatch 301 "^/$" "/_/index.html"
 
-RewriteCond %{REQUEST_URI} !^/doc/.*
-RewriteCond %{REQUEST_URI} ^(.*)/$
-RewriteRule ^(.*)/$ /_/$1.html [R=301,L]
+    # redirect old style top-level URLs
+    RewriteCond %{REQUEST_URI} !^/doc/.*
+    RewriteCond %{REQUEST_URI} ^(.*)/$
+    RewriteRule ^(.*)/$ /_/$1.html [R=301,L]
 
 
-<IfModule mod_rewrite.c>
-    RewriteEngine on
     Redirect 301 /blog.html /_/blog.html
     Redirect 301 /blog/2021/04/19/cass-world-party-speakers.html /blog/Speakers-Announced-for-April-28-Cassandra-4.0-World-Party.html
     Redirect 301 /blog/2021/04/12/cass-changelog_6.html /blog/Apache-Cassandra-Changelog-6-April-2021.html
@@ -32,4 +34,9 @@ RewriteRule ^(.*)/$ /_/$1.html [R=301,L]
     Redirect 301 /blog/2018/10/17/finding_bugs_with_property_based_testing.html /blog/Finding-Bugs-in-Cassandra's-Internals-with-Property-based-Testing.html
     Redirect 301 /blog/2018/08/21/testing_apache_cassandra.html /blog/Testing-Apache-Cassandra-4.html
     Redirect 301 /blog/2018/08/07/faster_streaming_in_cassandra.html /blog/Hardware-bound-Zero-Copy-Streaming-in-Apache-Cassandra-4.html
+
+    # redirect old style in-tree docs URLs
+    RewriteCond %{REQUEST_URI} !^/doc/(latest)/cassandra/.*
+    RewriteCond %{REQUEST_URI} ^/doc/(latest)/(.*)$
+    RewriteRule ^/doc/$1/cassandra/$2 [R=301,L]
 </IfModule>

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message