From 4d31779dd79ca814255e732747f1bcc373623f26 Mon Sep 17 00:00:00 2001 From: Misty Stanley-Jones Date: Mon, 19 Jan 2015 18:21:09 +1000 Subject: [PATCH] HBASE-11533 AsciiDoctor POC Addendum 2 to fix redirects during site generation --- hbase-common/src/main/resources/.htaccess | 8 -------- pom.xml | 21 ++++++++++++++++++++- src/main/site/resources/.htaccess | 8 ++++++++ src/main/site/resources/book/.empty | 1 + 4 files changed, 29 insertions(+), 9 deletions(-) delete mode 100644 hbase-common/src/main/resources/.htaccess create mode 100644 src/main/site/resources/.htaccess create mode 100644 src/main/site/resources/book/.empty diff --git a/hbase-common/src/main/resources/.htaccess b/hbase-common/src/main/resources/.htaccess deleted file mode 100644 index 5bfc3aa1196..00000000000 --- a/hbase-common/src/main/resources/.htaccess +++ /dev/null @@ -1,8 +0,0 @@ -# Redirect HTML-multi version of the book to HTML-single -# Rule added 2015-1-12 -- can be removed in 6 months -Redirect /book/ /book.html - -# Redirect replication URL to the right section of the book -# Rule added 2015-1-12 -- can be removed in 6 months -Redirect /replication.html /book.html#cluster_replication - diff --git a/pom.xml b/pom.xml index 3aef6d71b06..d0aa3898798 100644 --- a/pom.xml +++ b/pom.xml @@ -877,7 +877,7 @@ ${basedir}/target/site - ${basedir}/hbase-common/src/main/resources/ + ${basedir}/src/main/site/resources/ .htaccess @@ -885,6 +885,25 @@ + + + copy-empty-book-dir + + copy-resources + + post-site + + ${basedir}/target/site + + + ${basedir}/src/main/site/resources/ + + book/** + + + + + \ diff --git a/src/main/site/resources/.htaccess b/src/main/site/resources/.htaccess new file mode 100644 index 00000000000..20bf651e539 --- /dev/null +++ b/src/main/site/resources/.htaccess @@ -0,0 +1,8 @@ + +# Redirect replication URL to the right section of the book +# Rule added 2015-1-12 -- can be removed in 6 months +Redirect permanent /replication.html /book.html#_cluster_replication + +# Redirect old page-per-chapter book sections to new single file. +RedirectMatch permanent ^/book/(.*)\.html$ /book.html#$1 +RedirectMatch permanent ^/book/$ /book.html diff --git a/src/main/site/resources/book/.empty b/src/main/site/resources/book/.empty new file mode 100644 index 00000000000..5513814c36c --- /dev/null +++ b/src/main/site/resources/book/.empty @@ -0,0 +1 @@ +# This directory is here so that we can have rewrite rules in our .htaccess to maintain old links. Otherwise we fall under some top-level niceness redirects because we have a file named book.html.