[gnomemm-website] Added .htaccess rules so that old URL still take people to pages.



commit a5f62cf16cb1e0a2d2e8ee219f4a69518065416c
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jul 15 11:47:52 2010 +0200

    Added .htaccess rules so that old URL still take people to pages.
    
    * html/.htaccess: Added some voodoo rules to redirect *.shtml at the top to
    en/*.html (though it shows it as en/*.shtml unfortunately).

 ChangeLog      |    7 +++++++
 Makefile       |    2 +-
 html/.htaccess |   12 ++++++++++++
 3 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 107f8f1..6e5ea9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-15  Murray Cumming  <murrayc murrayc com>
+
+	Added .htaccess rules so that old URL still take people to pages.
+
+	* html/.htaccess: Added some voodoo rules to redirect *.shtml at the top to 
+	en/*.html (though it shows it as en/*.shtml unfortunately).
+
 2010-07-15  Tao Wang <dancefire gmail com>
 
 	Use DocBook XML to allow translation.
diff --git a/Makefile b/Makefile
index 87c6870..6b22bca 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@ dependencies_gnome_desktop:
 
 #post-html: dependencies_gtkmm dependencies_gnomemm dependencies_gnome_desktop
 post-html:
-	rsync -avz --rsh ssh --cvs-exclude  html/* $$USER www gtkmm org:$(web_path)
+	rsync -avz --rsh ssh --cvs-exclude  html/.htaccess html/* $$USER www gtkmm org:$(web_path)
 
 
 
diff --git a/html/.htaccess b/html/.htaccess
new file mode 100644
index 0000000..7451c93
--- /dev/null
+++ b/html/.htaccess
@@ -0,0 +1,12 @@
+RewriteEngine On
+RewriteBase /
+
+# Cut ".shtml" off the end of the request, to get the basename:
+RewriteRule ^(.*)\.shtml$ $1 [C,E=WasSHTML:yes]
+
+# Change the request for "basename.shtml" to "basename.html",
+RewriteRule ^(.*)$ $1.html
+
+# Redirect files at the top-level (the old ones) to the en/ subdirectory.
+RedirectMatch      301      ^/([^/]*)$      http://www.gtkmm.org/en/$1
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]