Connecting Tech Pros Worldwide Help | Site Map

Detect active url then autonavigate to subdir

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 10:42 AM
Hans Hasenack
Guest
 
Posts: n/a
Default Detect active url then autonavigate to subdir

This is the problem:
I've got a home dir home.provider.nl/username

and two registered domains www.firsturl.nl and www.nexturl.nl
These are both pointing to the same home directory

How can I (automatically) switch to another page based upon the url used for
navigating to my home directory.

some Restrictions
* must be javascript or DHTML.
* cannot be ASP
* I cannot change the registerd domains to use a sub directory of my home
dir, only the 'root' of my home dir

TIA

Hans

Res



  #2  
Old July 23rd, 2005, 10:43 AM
kaeli
Guest
 
Posts: n/a
Default Re: Detect active url then autonavigate to subdir

In article <4098028b$0$124$3a628fcd@reader3.nntp.hccnet.nl> ,
h.remthishasenack@hccnet.nl enlightened us with...[color=blue]
> This is the problem:
> I've got a home dir home.provider.nl/username
>
> and two registered domains www.firsturl.nl and www.nexturl.nl
> These are both pointing to the same home directory
>
> How can I (automatically) switch to another page based upon the url used for
> navigating to my home directory.
>
> some Restrictions
> * must be javascript or DHTML.[/color]

Why?
This is best (easiest, simplist, and doesn't require anything from the
client) done via server redirects. Anything else might not work on some
browsers.
Do you have Apache .htaccess available? If you don't know, ask your host
or provide your host URL. Even a php script is preferable to a client-
side script for something this integral to site functioning.

If you insist on client-side, look at meta refresh tags, but be aware
they are blockable/disabled on some browsers, including IE6.

--
--
~kaeli~
Suicide is the most sincere form of self-criticism.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

  #3  
Old July 23rd, 2005, 10:44 AM
Shawn Milo
Guest
 
Posts: n/a
Default Re: Detect active url then autonavigate to subdir

"Hans Hasenack" <h.remthishasenack@hccnet.nl> wrote in message news:<4098028b$0$124$3a628fcd@reader3.nntp.hccnet. nl>...[color=blue]
> This is the problem:
> I've got a home dir home.provider.nl/username
>
> and two registered domains www.firsturl.nl and www.nexturl.nl
> These are both pointing to the same home directory
>
> How can I (automatically) switch to another page based upon the url used for
> navigating to my home directory.
>
> some Restrictions
> * must be javascript or DHTML.
> * cannot be ASP
> * I cannot change the registerd domains to use a sub directory of my home
> dir, only the 'root' of my home dir
>
> TIA
>
> Hans
>
> Res[/color]



Try this:

//make window.location into a string
var currentURL = '' + window.location;

if (currentURL.match('firsturl')){
window.location = 'http://www.google.com';
}else{
window.location = 'http://www.yahoo.com';
}


This works for me in IE6 and Mozilla Firefox.

Shawn
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.