Changeset 357 in t29-www for index.php


Ignore:
Timestamp:
Mar 8, 2013, 5:04:14 PM (10 years ago)
Author:
sven
Message:

t29Host-Webroot-System entwickelt.

Damit können Installationen der technikum29-Website ab nun auch in Unterverzeichnissen
(bislang allerdings nur unterhalb des DocumentRoots) installiert werden, was einem
größere Flexibilität beim lokalen Aufsetzen der Seite liefert

File:
1 edited

Legend:

Unmodified
Added
Removed
  • index.php

    r288 r357  
    55 $de = strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'de');
    66 $en = strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'en');
    7 
     7 
     8 // Support web prefixes, aka installation of the homepage in
     9 // subdirectorys and not in virtual hosts
     10 // Basically relative redirects would do the trick, too,
     11 // but officially they are not allowed (not standard compilant)
     12 include "lib/host.php";
     13 $host = t29Host::detect();
     14 // this is not implemented in the HTML below, since actually
     15 // there is no browser who see's that HTML.
     16 
    817 if( ($en !== false && $de !== false && $de < $en) ||
    918     ($en === false && de !== false)              )
    10         header("Location: /de/");
     19        header("Location: {$host->web_prefix}/de/");
    1120 else
    12         header("Location: /en/");
     21        header("Location: {$host->web_prefix}/en/");
    1322?>
    1423<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License