473,322 Members | 1,352 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,322 software developers and data experts.

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
Jul 23 '05 #1
2 3501
In article <40*********************@reader3.nntp.hccnet.nl> ,
h.***************@hccnet.nl 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

Jul 23 '05 #2
"Hans Hasenack" <h.***************@hccnet.nl> wrote in message news:<40*********************@reader3.nntp.hccnet. 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
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: David McCulloch | last post by:
QUESTION-1: How can I detect if Norton Internet Security is blocking pop-ups? QUESTION-2a: How could I know if a particular JavaScript function has been declared? QUESTION-2b: How could I...
6
by: Richard | last post by:
I have now finally got the JSCookMenu to work (hooray!) But every time I test it, my IE browser delivers an "Information Bar" warning about active content. The MS Help says "This message...
3
by: matt.b.williams | last post by:
I am wondering if there is a way to programmatically detect active connections on a RAS server. My situation is this. An app will be running on the RAS server. This app will have a timer that...
4
by: Jarod_24 | last post by:
How do a windows-service detect whether a user is logged or not on a computer? So far i've found nothing in the windows api or any code examples that will allow me to figure this out. The...
2
by: Bill nguyen | last post by:
Please tell me the Datagrid events that I can use to detect data entry in a single cell of the active row. I need to put a value in another cell based on user input on other cells in the active...
8
by: BJ | last post by:
Problem: How can I code up a client side process to detect if the network is available? Synopsis: I am writing ASP.NET input forms for a Panasonic Tuff book. The users will be walking around...
4
by: Dst | last post by:
This is what i'm trying to do: I'm porting a windows app to a web app. I have a webform which will edit some data stored in a database. The data needs to be locked in the database, while editing....
12
by: Phil | last post by:
I can check for MdiChildren.Length=0, but which event handler should I put this in to detect when a child window is closed? TIA Phil.
18
by: sebastian | last post by:
Can this be done without client-side scripting? I thought sessions might be the answer but after some testing found that sometimes the old session data remained even after the user left the site...
0
by: AlannY | last post by:
Hi there. I'm writing a tool, which must detect is connection was terminated on remote side. Every action on network, I'm fetching with select(). And I want in some place check if connection still...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.