Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Detect active url then autonavigate to subdir

Reply
Thread Tools

Detect active url then autonavigate to subdir

 
 
Hans Hasenack
Guest
Posts: n/a
 
      05-04-2004
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


 
Reply With Quote
 
 
 
 
kaeli
Guest
Posts: n/a
 
      05-05-2004
In article <4098028b$0$124$(E-Mail Removed)> ,
http://www.velocityreviews.com/forums/(E-Mail Removed) enlightened us with...
> 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.


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

 
Reply With Quote
 
 
 
 
Shawn Milo
Guest
Posts: n/a
 
      05-05-2004
"Hans Hasenack" <(E-Mail Removed)> wrote in message news:<4098028b$0$124$(E-Mail Removed). nl>...
> 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




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
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Location of linked referenced assembly in application bin subdir Michel Gallant ASP .Net 0 10-14-2005 02:03 PM
Help. SessionID is x then y then x then y BodiKlamph@gmail.com ASP General 0 09-03-2005 03:02 PM
relative linking of files, can I indicate root no matter the level (subdir) ? Peter Van Hove HTML 3 04-22-2005 01:02 PM
How do I import everything in a subdir? Dfenestr8 Python 5 03-07-2005 09:24 AM
View a list of files in a SubDir news-server HTML 1 07-11-2003 07:41 PM



Advertisments