473,395 Members | 2,446 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,395 software developers and data experts.

How do I automatically load a different page ?

The browser goes to
"DIR_A/index.html"

but I want it redirected to to:
"DIR_B/topic/index.html"

What do I put in "DIR_A/index.html" to make it so ?

Here is my code and it does not work. What am I doing wrong ? I
just get a blank white page.

I've tried
top.location.href="./../DIR_B/topic/index.html";

and
<body onload="doInit()"?
instead, but no joy either.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script language="javascript">
<!--
window.onload=doInit

function doInit(){
location.href="./../DIR_B/topic/index.html";
}
//-->
<title>Page B index</title>
</head>
<body bgcolor="#ffffff">
</body>
</html>

Jul 23 '05 #1
2 2097
Zenobia wrote:
The browser goes to
"DIR_A/index.html"

but I want it redirected to to:
"DIR_B/topic/index.html"

What do I put in "DIR_A/index.html" to make it so ?


You don't. You need to configure the server to do a redirect. If the
server is Apache and you are allowed to write .htaccess files, use this
in DIR_A/.htaccess (all one line, may wrap here):

Redirect permanent index.html http://www.example.com/DIR_B/topic/index.html

If you are talking about a non-served site (on a CD, for example, and
therefore off topic here), look up "meta refresh" for a horrible way to
do it.

--
Mark.
http://tranchant.plus.com/
Jul 23 '05 #2
On Wed, 10 Nov 2004 12:11:56 +0000, Mark Tranchant
<ma**@tranchant.plus.com> wrote:
Zenobia wrote:
The browser goes to
"DIR_A/index.html"

but I want it redirected to to:
"DIR_B/topic/index.html"

What do I put in "DIR_A/index.html" to make it so ?


You don't. You need to configure the server to do a redirect. If the
server is Apache and you are allowed to write .htaccess files, use this
in DIR_A/.htaccess (all one line, may wrap here):

Redirect permanent index.html http://www.example.com/DIR_B/topic/index.html

If you are talking about a non-served site (on a CD, for example, and
therefore off topic here), look up "meta refresh" for a horrible way to
do it.


Thanks, that horrible way worked. It is a page on an intranet -
not the web. If html intranet pages are off-topic here then
which group is on topic for such pages?

Jul 23 '05 #3

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

Similar topics

1
by: Alan | last post by:
Hi there, Are there Excel charting gurus here?? If so then please read on... Sorry for the cross-post but I'm not familiar with the Excel groups. I've posted to asp.general because if I have...
5
by: Alan | last post by:
Hi there, Are there Excel charting gurus here?? If so then please read on... Sorry for the cross-post but I'm not familiar with the Excel groups. I've posted to asp.general because if I have...
37
by: ajay | last post by:
How to make a web page getting refreshed after a given time interval automatically. HTML Code plz. Tx Ajay
3
by: Shapper | last post by:
Hello, I am working on an ASP.NET/VB web site. I have several links including menu links. Considerer a want to load a page named page.aspx. I can do it using javascript. Or using this code:...
9
by: netasp | last post by:
hi all, how can I populate one aspx form when page is loading based on page ID? for example: loading page A (to search for VB code) would display labels and texboxes, dropdown lists all related...
3
by: McGowan | last post by:
the basic idea here is that I want a web page that is made up of frames to redirect automatically to a frame depending on an if statement... if($1 == $2) { load url1.php in frame "main" }else...
1
kbnsarma
by: kbnsarma | last post by:
I have prepared a Package and one of its reports is that every day morning at 9-00am it should extract data from database as per specified query and send E-mails to all concerned with the results. ...
3
manuelgk
by: manuelgk | last post by:
Hi!, does anybody know how to load a different Web page using a hyperlink?. Now I have my code with some "<a href>" when I click the link, it load the URL of the <a href>. My question is how can I...
7
by: amishguy | last post by:
Hello, I am having an issue with a site I'm creating right now. I have had this issue before and I would like to figure out what the solution is instead of using workarounds as I have in the...
0
by: vps | last post by:
The HTML document that Flash CS3 (version 9.0) creates when you choose “Publish” in “File” Menu loads a page which looks blank in browser. Only if you blindly locate the Flash object on this page,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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,...

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.