By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,032 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

2 Websites on 1 url

P: n/a
Hello there,

I'm looking for some code to split a website that is hosted on one server.

For example: I have the domain www.firstone.com and www.secondone.nl
They're both hosted at one provider. So far no problems. The ISP makes the
changes in the dns and when you type in the urls you'll arrive at the same
website's index.html

But, I want to create a separate entrance for the english part of the
website and a separate entrance for the dutch website.

I know there is some javascript to do this, but hey ! Who wants to use that
..... ?

Can anyone help me out with this one ?

Jos de Nijs
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
<jo*********@f1help.org> wrote in message
news:10*************@corp.supernews.com...
Hello there,

I'm looking for some code to split a website that is hosted on one server.

For example: I have the domain www.firstone.com and www.secondone.nl
They're both hosted at one provider. So far no problems. The ISP makes the
changes in the dns and when you type in the urls you'll arrive at the same
website's index.html

But, I want to create a separate entrance for the english part of the
website and a separate entrance for the dutch website.

I know there is some javascript to do this, but hey ! Who wants to use that .... ?

Can anyone help me out with this one ?

Jos de Nijs


First make sure your server supports PHP. Then get rid of index.html and
make a page called index.php and put this code in it:

<?php
$de_url="secondone.nl"; // change this to the URL that you want redirected
to the Dutch frontpage
$de_frontpage="de_frontpage.html"; // change this to the filename of the
Dutch frontpage
$en_frontpage="en_frontpage.html"; // change this to the filename of the
English frontpage

if (strstr($_SERVER['SERVER_NAME'],$de_url)) {
header("Location: $de_frontpage");
} else {
header("Location: $en_frontpage");
}
?>
Jul 17 '05 #2

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In comp.lang.php, <jo*********@f1help.org> (jo*********@f1help.org) wrote:
For example: I have the domain www.firstone.com and www.secondone.nl
They're both hosted at one provider. So far no problems. The ISP makes the
changes in the dns and when you type in the urls you'll arrive at the same
website's index.html


I think the most convenient way to achieve this is to ask your
provider to use VirtualHosts (if using Apache, there are other
approaches if using a different server). That might suit your needs
just fine.

Regards.

- --
My real e-mail address: chema (AT) chema.homelinux.org
http://EuropeSwPatentFree.hispalinux.es - EuropeSwPatentFree
I don't read HTML posts / No leo mensajes en HTML
Blog Overflow: http://chema.homelinux.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAw24F9P6GbSlI+hkRAsKHAKCNYNuizFbAQyA63cuCMJ ytc1BsAACgnLW0
gJb7horDYoK7USjF59k0wPY=
=0Vjm
-----END PGP SIGNATURE-----
Jul 17 '05 #3

P: n/a
In article <10*************@corp.supernews.com>, <jo*********@f1help.org> wrote:
But, I want to create a separate entrance for the english part of the
website and a separate entrance for the dutch website.


Meaby this is useful? http://www.grep.be/data/accept-to-gettext.inc

--
Tim Van Wassenhove <http://home.mysth.be/~timvw/contact.php>
Jul 17 '05 #4

P: n/a
<jo*********@f1help.org> wrote in message
news:<10*************@corp.supernews.com>...

I'm looking for some code to split a website that is hosted on one server.

For example: I have the domain www.firstone.com and www.secondone.nl
They're both hosted at one provider. So far no problems. The ISP makes the
changes in the dns and when you type in the urls you'll arrive at the same
website's index.html

But, I want to create a separate entrance for the english part of the
website and a separate entrance for the dutch website.


The best solution is to configure your Web server appropriately.
If you are running Apache, you should use mod_rewrite. Depending
on which site is being requested, mod_rewrite will redirect the
request to the appropriate file without user noticing anything.

A more PHP-oriented solution (one of many possible) would be to
place this file in your root directory as index.php:

<?php
if (strstr(strtolower($_SERVER['SCRIPT_URI']), 'secondone.nl'))) {
header('Location: http://www.secondone.nl/hollands/');
} else {
header('Location: http://www.firstone.com/english/');
}
?>

Needless to say, your Dutch site would be hosted in the /hollands
directory, while your English site would be located in the /english
directory...

Cheers,
NC
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.