0
votes

I have a Drupal-Site with 2 different Language versions (DE & EN). They use different Domains. I want to make sure, that German content can only be viewed if the User uses the German domain. So if a guy who uses my English page calls some German content, he should get a 404 page. Is this possible? How?

2

2 Answers

1
votes

One easy way might be adding following condition in the preprocess_node hook of your custom module:

if(!($_SERVER['SERVER_NAME'] == "www.german-site.com" && $vars['node']->language == "DE")
&& !($_SERVER['SERVER_NAME'] == "www.english-site.com" && $vars['node']->language == "EN")
){
    drupal_set_header('HTTP/1.1 404 Gone');
    print theme('page', 'Requested page not found.', FALSE);

}

Hope this will help.

0
votes

You should select a language when you add the content. And same will be available to respective language!