2 Websites on 1 url

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    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


  • kingofkolt

    #2
    Re: 2 Websites on 1 url

    <jos.de.nijs@f1 help.org> wrote in message
    news:10c6oc2gvr 3js40@corp.supe rnews.com...[color=blue]
    > 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[/color]
    that[color=blue]
    > .... ?
    >
    > Can anyone help me out with this one ?
    >
    > Jos de Nijs
    >
    >[/color]

    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="second one.nl"; // change this to the URL that you want redirected
    to the Dutch frontpage
    $de_frontpage=" de_frontpage.ht ml"; // change this to the filename of the
    Dutch frontpage
    $en_frontpage=" en_frontpage.ht ml"; // change this to the filename of the
    English frontpage

    if (strstr($_SERVE R['SERVER_NAME'],$de_url)) {
    header("Locatio n: $de_frontpage") ;
    } else {
    header("Locatio n: $en_frontpage") ;
    }
    ?>


    Comment

    • José María Mateos

      #3
      Re: 2 Websites on 1 url

      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      In comp.lang.php, <jos.de.nijs@f1 help.org> (jos.de.nijs@f1 help.org) wrote:[color=blue]
      > 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[/color]

      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 - EuropeSwPatentF ree
      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)

      iD8DBQFAw24F9P6 GbSlI+hkRAsKHAK CNYNuizFbAQyA63 cuCMJytc1BsAACg nLW0
      gJb7horDYoK7USj F59k0wPY=
      =0Vjm
      -----END PGP SIGNATURE-----

      Comment

      • Tim Van Wassenhove

        #4
        Re: 2 Websites on 1 url

        In article <10c6oc2gvr3js4 0@corp.supernew s.com>, <jos.de.nijs@f1 help.org> wrote:[color=blue]
        > But, I want to create a separate entrance for the english part of the
        > website and a separate entrance for the dutch website.[/color]

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

        --
        Tim Van Wassenhove <http://home.mysth.be/~timvw/contact.php>

        Comment

        • Nikolai Chuvakhin

          #5
          Re: 2 Websites on 1 url

          <jos.de.nijs@f1 help.org> wrote in message
          news:<10c6oc2gv r3js40@corp.sup ernews.com>...[color=blue]
          >
          > 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.[/color]

          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(strtolo wer($_SERVER['SCRIPT_URI']), 'secondone.nl') )) {
          header('Locatio n: http://www.secondone.n l/hollands/');
          } else {
          header('Locatio n: http://www.firstone.co m/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

          Comment

          Working...