Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

javascript, how to redirect (from index.html page) but does not show url of the new page

Posted on 2011-02-23
5
Medium Priority
?
686 Views
Last Modified: 2012-05-11
How to redirect (from index.html page) but does not show url of the new page
For example, type in the domain (e.g. http://testwebpage.com)  this takes  me to my index page, which I want to redirect somewhere else.  However I don't want to see the new url on the browser.
My code so far:

<script language="JavaScript">
function redirectToNewPage(){
  location.href="/dir1/newpage.html";
}
</script>

</HEAD>
<BODY bgcolor="black" text=white onLoad="redirectToNewPage()">
</BODY>
</HTML>

0
Comment
Question by:rgbcof
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 34966224
do you have the control of the index page ?
0
 
LVL 4

Accepted Solution

by:
LAMASE earned 1000 total points
ID: 34966252
You can empty the current dom and insert an iframe with src="theotherpage".
Why do you need to hide an url?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 34966265
This is you index.php :


<?PHP
   $content = file_get_contents("/dir1/newpage.html");
   echo $content;
?>

Open in new window

0
 
LVL 12

Expert Comment

by:Amick
ID: 34967301
No need to use JavaScript . Try
<html>
<head>

</head>
<body>
<object type="text/html" height="100%" width="100%"
data="http://www.experts-exchange.com/">
</object>
</body>
</html>

Open in new window


or
<html>
 <head>
 <title>OBJECT</title>
 <frameset cols = "100%">
 <frame src="http://www.experts-exchange.com" />
 </frameset>
 </head>
 <body>
 </body>
 </html>

Open in new window


0
 

Author Closing Comment

by:rgbcof
ID: 34971852
It turns out the an iframe is the best solution.  The url never divulge any path below  it.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question