473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

2 Websites on 1 url

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
4 2039
<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
-----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
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
<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: gary | last post by:
Hi all, According to you, what are the best tutorial / news PHP website ? thx in advance, -- gary
0
by: Markus Franz | last post by:
Hi. I have a difficult problem: An array contains several different URLs. I want to load these websites in parallel by using a HTTP-Request. How can I do this in PHP? Up to now I did this...
1
by: jason | last post by:
I have various small html websites on my windows server 2003 pc, these function quite happily from directories under D:\websites via ports 81, 8081, 8091, 8082 and of course there is the dafault...
2
by: Generic Usenet Account | last post by:
I am trying to create a Java application that reads a list of URLs from a file and stores their contents on the local file system. I have succeeded in accessing normal websites, but I am unable to...
1
by: Dean R. Henderson | last post by:
I setup FormsAuthentication on a couple websites where it has been working as expected for a long time. I used this code to setup the same type of authentication on a new website I am working on...
0
by: CNN_news | last post by:
I would like to run multiple instances of TYPO3 (a cms written in PHP) on a single server. You can run multiple websites in two methods: multisite or multiple instances. In multiple...
9
by: moondaddy | last post by:
I'm using asp.net 2.0 and c# and would like to share some user control between several websites. these websites are on the same server and have a physical location right next to each other like...
0
by: santwize | last post by:
Hi all, I have developed three to four websites which are working fine and now that we feel websites are not meeting the standards so i need to implement standards to confirm the long life of my...
3
by: teddarr | last post by:
I have a Windows Server 2003. I am trying to run multiple websites on the server. I have 3 different websites I'd like to run. Currently the default website is working but no others. All...
0
by: teddarr | last post by:
I have a Windows Server 2003. I am trying to run multiple websites on the server. I am using host headers to run the websites on only one ip address. Before anyone says this is an iis issue and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.