phpwcms with multiple domains

FIXME Translate

From Jörg Alblecht Blog:

“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.

Here comes a little workaround into the game:

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. 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.”

    <?php
 
        if ( $_SERVER[`SERVER_NAME`] == `www.domain1.tld` ) {
            header( "HTTP/1.1 301 Moved Permanently" );
            header(`Location: http://`. $_SERVER[`SERVER_NAME`] .`/index.php?content1`);
        }
 
        if ( $_SERVER[`SERVER_NAME`] == `www.domain2.tld` ) {
            header( "HTTP/1.1 301 Moved Permanently" );
            header(`Location: http://`. $_SERVER[`SERVER_NAME`] .`/index.php?content2`);
        }
 
    ?>


3. To make sure that “redirect.php” is executed before “index.php” you will add the following line of code to your ”.htaccess”:

DirectoryIndex redirect.php index.php


That's all so far!


Quote of Mittwoch, 05.03.2008 aus: Jörg Alblecht Blog


Knut Heermann (flip-flop) 2011/03/13 08:57

english/other-enhancements/multiple-domains.txt · Last modified: 2011/07/22 18:58 by Claus
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0