NAVIGATION
This shows you the differences between two versions of the page.
|
english:other-enhancements:multiple-domains [2011/03/13 09:37] Knut Heermann (flip-flop) created |
english:other-enhancements:multiple-domains [2018/06/03 18:09] (current) |
||
|---|---|---|---|
| Line 7: | Line 7: | ||
| From [[http://www.joergalbrecht.de/blog/?tag=phpwcms|Jörg Alblecht Blog]]: | From [[http://www.joergalbrecht.de/blog/?tag=phpwcms|Jörg Alblecht Blog]]: | ||
| - | "Das Content-Management-System phpwcms bringt von Hause aus keine Funktion für mehrere Domains mit. Wenn man das System auf einem Webspace-Paket installiert, welches mit mehreren Domains konnektiert ist, wird also standardmäßig unter jeder Domain der gleiche Inhalt angezeigt. Wenn eine Internetpräsenz über verschiedene Länder- und Sprachversionen verfügt, kann es jedoch wünschenswert sein, dass jede einzelne Domain direkt mit einer spezifischen Einstiegsseite beginnt. | + | "The phpwcms CMS doen't support more than one domain at a first glance. If you install it into a webspace which is connected to more than one domain the same content will be displayed for every single domain per default. But if you have different website content for different languages or countries you certainly would like to schow the appropriate content for a certain domain - english content with a com-domain, german one with a de-domain. You'll need a starting point definition and an entry page. |
| - | Dazu ist lediglich der folgende kleine Workaround nötig. | + | Here comes a little workaround into the game: |
| - | 1. Zunächst muss eine Datei angelegt werden, welche die verschiedenen Domains mit unterschiedlichen Inhaltsseiten verknüft. Ich nenne diese meist redirect.php. \\ | + | 1. First of all you'll like to set up a file which will contain some code to link the different languages into the different domains. Let's name it redirect.php. \\ |
| - | 2. In diese Datei kommt folgender Code, welcher angepasst werden muss und um beliebig viele Domains ergänzt werden kann." \\ | + | 2. This redirect.php will contain the following code (you'll have to adapt it and it can be extented with as many domains as needed." \\ |
| Line 20: | Line 20: | ||
| if ( $_SERVER[`SERVER_NAME`] == `www.domain1.tld` ) { | if ( $_SERVER[`SERVER_NAME`] == `www.domain1.tld` ) { | ||
| header( "HTTP/1.1 301 Moved Permanently" ); | header( "HTTP/1.1 301 Moved Permanently" ); | ||
| - | header(`Location: http://`. $_SERVER[`SERVER_NAME`] .`/index.php?inhalt1`); | + | header(`Location: http://`. $_SERVER[`SERVER_NAME`] .`/index.php?content1`); |
| } | } | ||
| if ( $_SERVER[`SERVER_NAME`] == `www.domain2.tld` ) { | if ( $_SERVER[`SERVER_NAME`] == `www.domain2.tld` ) { | ||
| header( "HTTP/1.1 301 Moved Permanently" ); | header( "HTTP/1.1 301 Moved Permanently" ); | ||
| - | header(`Location: http://`. $_SERVER[`SERVER_NAME`] .`/index.php?inhalt2`); | + | header(`Location: http://`. $_SERVER[`SERVER_NAME`] .`/index.php?content2`); |
| } | } | ||
| Line 33: | Line 33: | ||
| \\ | \\ | ||
| - | 3. Damit die Datei "redirect.php" vor der "index.php" ausgeführt wird, muss in der ".htaccess" noch folgende Zeit hinzugefügt werden: | + | 3. To make sure that "redirect.php" is executed before "index.php" you will add the following line of code to your ".htaccess": |
| <code> | <code> | ||
| Line 39: | Line 39: | ||
| </code> | </code> | ||
| \\ | \\ | ||
| - | Das war es dann schon! | + | That's all so far! |
| \\ | \\ | ||
| - | Zitat vom Mittwoch, 05.03.2008 aus: [[http://www.joergalbrecht.de/blog/?tag=phpwcms|Jörg Alblecht Blog]] | + | Quote of Mittwoch, 05.03.2008 aus: [[http://www.joergalbrecht.de/blog/?tag=phpwcms|Jörg Alblecht Blog]] |
| \\ | \\ | ||