]> git.ipfire.org Git - ipfire.org.git/commitdiff
From now on, we can link all sites like: http://www.ipfire.org/downloads.shtml
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 22 Aug 2008 11:32:53 +0000 (13:32 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 22 Aug 2008 11:32:53 +0000 (13:32 +0200)
and the webserver will redirect to the right language.

www/.htaccess
www/index.py

index 0975e2c9bdce57e22f9bcb489f426d6546b2fb24..9f3bb07481c1732feadf986c17bbe1c80acba904 100644 (file)
@@ -1 +1,6 @@
-DirectoryIndex index.pl index.shtml
+DirectoryIndex index.py index.shtml
+
+RewriteEngine on
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^(.*).shtml$ index.py?file=$1.shtml
index 58d5736609364b1ea2298bcc54b0755715e4a81c..3acfdb5dc263a460b5f0e2069b8ecf64262f8e9f 100755 (executable)
@@ -2,10 +2,11 @@
 
 import os
 import re
+import cgi
 
 sites = (
                        ("ipfire.org", ("www.ipfire.org", None)),
-                       ("www.ipfire.org", (None, "index.shtml")),
+                       ("www.ipfire.org", (None, cgi.FieldStorage().getfirst("file") or "index.shtml")),
                        ("source.ipfire.org", (None, "source.shtml")),
                        ("tracker.ipfire.org", (None, "tracker.shtml")),
                        ("download.ipfire.org", (None, "download.shtml")),
@@ -18,7 +19,6 @@ try:
                language = "de"
 except KeyError:
        pass
-       
 
 print "Status: 302 Moved"
 print "Pragma: no-cache"