Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2012, 08:50:47 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155442 Posts in 21702 Topics by 7731 Members
Latest Member: zvaigzdzius
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: 2 domains, different pages in different languages  (Read 674 times)
GadgetDon

Offline Offline

Posts: 2


« on: October 19, 2008, 06:47:36 PM »

I'm working on a website, where there is a url.de and url.com.  I want the url.de to go to /pages/de.php and the url.com to go to /pages/en.php

Unfortunately, when I have an intro page set up, it's always based on the WB_URL, which is the de address.

Is there a way to do what I want?  Or do I always have to have everyone go to one language, and then click the language flags to switch?
Logged
BerndJM

Offline Offline

Posts: 1764



« Reply #1 on: October 19, 2008, 07:19:10 PM »

Hi,
have done a similar thing with some modification in the config.php:
Code:
define('WB_URL', 'http://'.$_SERVER['SERVER_NAME']);

if ($_SERVER['SERVER_NAME'] == 'your-domain.com') {
    define ('TEMPLATE_DIR', WB_URL.'/templates/com'); //only needed if you use 2 different templates
    if (!isset($page_id)) {
    $page_id = 35; //the page_id for the startpage for the com domain
    }
} else {
    define ('TEMPLATE_DIR', WB_URL.'/templates/de'); //only needed if you use 2 different templates
}

Assuming your-domain.de is the "normal" entry.
All the .de pages resist in /pages/de and the .com pages in /pages/com
Also you have to use 2 menus in the info php
Code:
$menu[1] = "de Menu";
$menu[2] = "com Menu";
And you show_menu has to start on root+1
Hope this helps.

Regards Bernd
Logged

In theory, there is no difference between theory and practice. But, in practice, there is.
GadgetDon

Offline Offline

Posts: 2


« Reply #2 on: October 19, 2008, 07:34:41 PM »

Beautiful!  The change to config.php's definition of WB_URL did it for me.  We don't have different templates, instead I have an intro page that redirects to en.php or de.php based on domain
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!