473,470 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
Jul 20 '05 #1
2 1326
JCO
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:
http://www.hotscripts.com/Detailed/20848.html
"Robert Brown" <rb*******@charter.net> wrote in message
news:10*************@corp.supernews.com...
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

Jul 20 '05 #2
Robert Brown wrote:
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


thisLocation = document.location.href;
if (thisLocation.indexOf('domainy') == -1){
document.location.href = 'someOtherPage.html'
}

Thats if you have no server side capabilities.

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

Jul 20 '05 #3

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

Similar topics

10
by: Bob Garbados | last post by:
forgive my ignorance, as I'm new to php coming from a ms background... If I create a page named redirect.php and it's only content is: <?php header("Location: http://www.google.com"); ?>...
2
by: Sentinel | last post by:
here is the entire thread From: "Kimmo Laine" <eternal.erectionN0.5P@Mgmail.com> Subject: Re: script in body Date: Mon, 20 Jun 2005 17:46:28 +0300 Message-ID:...
6
by: Tim Stokes | last post by:
Hi all, I want to do a similar action to response.redirect ("file.htm"). But the file.htm contains some sensitive data. I have placed file.htm in a folder in the InetPub...
1
by: Paul Oakfleet | last post by:
The script below will disable Submit button until user accept terms, and will redirect user to another page after clicking on Submit button. The script seems to work fine on my PC (Windows XP,...
7
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script...
3
by: Sehboo | last post by:
On my ASP page, when I click a button, I want to do three things: 1. Check for some values. 2. Open a new window and pass some values as query string. 3. Redirect to some other page Here...
5
by: Josselin | last post by:
I have a page 'pni.php' to which paypal is redirecting after payment thsi page contains a db update script, no problem it's running well but once this script is executed (transparently for the...
4
by: Dave | last post by:
Is there a way to do a Response.Redirect and do a popup on the redirect?
7
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I...
1
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.