Solved

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

Posted on 2011-02-23
3
324 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
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
sjklein42 earned 250 total points
ID: 34966203
You could hide it in an IFRAME, like this.  It may take some tuning to get the scrollbars right.
<html><body leftmargin=0 topmargin=0><iframe src="http://www.myotherdomain.com/myotherpage.html" width=100% height=100% frameborder=0 scrolling=auto></iframe></body></html>

Open in new window

0
 
LVL 16

Expert Comment

by:sjklein42
ID: 34966468
Create this file, call it ".htaccess" with the leading dot.

Edit to substitute your pages for "visible.html" and "hidden.html".

Put it in your web site folder

When the user goes to visible.html, they actually see the contents of "hidden.html" but the address field still says "visible.html".

Options +FollowSymLinks
 
RewriteEngine On
RewriteBase /

RewriteRule ^visible.html$ hidden.html

Open in new window

0
 

Author Closing Comment

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

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

738 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