Redirect Script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert Brown

    Redirect Script

    Hi,
    I am very new to writing scripts. I was wondering if someone could help
    me with my code. I have two domain names: 'domainx' and 'domainy'. They
    both point to the same directory on the web server and by default, both
    point to index.html. If the user types in http://www.domainx.com I want
    them to see the index.html page. However, if they type in
    http://www.domainy.com I want it to redirect to another page in that
    directory. Can that be done and if so, how can that be done in JavaScript?
    Any steps in the right direction would be greatly appreciated.
    Thanks,
    Robert


  • JCO

    #2
    Re: Redirect Script

    Search for COOL_REDIRECT. I used some code that was already written. This
    will even place a countdown number before the redirection takes place
    (rather you need it or not).

    Also:



    "Robert Brown" <rbrown001@char ter.net> wrote in message
    news:103fi1hidm h8e0a@corp.supe rnews.com...[color=blue]
    > Hi,
    > I am very new to writing scripts. I was wondering if someone could help
    > me with my code. I have two domain names: 'domainx' and 'domainy'. They
    > both point to the same directory on the web server and by default, both
    > point to index.html. If the user types in http://www.domainx.com I want
    > them to see the index.html page. However, if they type in
    > http://www.domainy.com I want it to redirect to another page in that
    > directory. Can that be done and if so, how can that be done in[/color]
    JavaScript?[color=blue]
    > Any steps in the right direction would be greatly appreciated.
    > Thanks,
    > Robert
    >
    >[/color]


    Comment

    • Randy Webb

      #3
      Re: Redirect Script

      Robert Brown wrote:
      [color=blue]
      > Hi,
      > I am very new to writing scripts. I was wondering if someone could help
      > me with my code. I have two domain names: 'domainx' and 'domainy'. They
      > both point to the same directory on the web server and by default, both
      > point to index.html. If the user types in http://www.domainx.com I want
      > them to see the index.html page. However, if they type in
      > http://www.domainy.com I want it to redirect to another page in that
      > directory. Can that be done and if so, how can that be done in JavaScript?
      > Any steps in the right direction would be greatly appreciated.
      > Thanks,
      > Robert[/color]

      thisLocation = document.locati on.href;
      if (thisLocation.i ndexOf('domainy ') == -1){
      document.locati on.href = 'someOtherPage. html'
      }

      Thats if you have no server side capabilities.

      --
      Randy
      Chance Favors The Prepared Mind
      comp.lang.javas cript FAQ - http://jibbering.com/faq/

      Comment

      Working...