]> git.ipfire.org Git - ipfire.org.git/blame - www/index.py
Define "heading" XML tag to set as HTML-anchor
[ipfire.org.git] / www / index.py
CommitLineData
2580619c
MT
1#!/usr/bin/python
2
3import os
4import re
be58ffcc 5import cgi
2580619c 6
2580619c 7# Check language...
a793fc55
MT
8language = "en"
9try:
10 if re.search(re.compile("^de(.*)"), os.environ["HTTP_ACCEPT_LANGUAGE"]):
11 language = "de"
12except KeyError:
13 pass
2580619c 14
8117d35b
MT
15index = cgi.FieldStorage().getfirst("file") or "index"
16
17sites = (
18 ("ipfire.org", ("www.ipfire.org", None)),
19 ("www.ipfire.org", (None, index + "/%s" % language)),
20 ("source.ipfire.org", ("www.ipfire.org", "source/" + language)),
21 ("tracker.ipfire.org", ("www.ipfire.org", "tracker/" + language)),
22 ("download.ipfire.org", ("www.ipfire.org", "download/" + language)),
23 ("people.ipfire.org", ("wiki.ipfire.org", language + "/people/start")),
24 )
25
2580619c
MT
26print "Status: 302 Moved"
27print "Pragma: no-cache"
28
29location = ""
30
31for (servername, destination) in sites:
32 if servername == os.environ["SERVER_NAME"]:
33 if destination[0]:
34 location = "http://%s" % destination[0]
35 if destination[1]:
8117d35b 36 location += "/%s" % destination[1]
2580619c
MT
37 break
38
39print "Location: %s" % location
40print # End the header