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

How to redirect (from index.html page) but does not show url of the new page
For example, type in the domain (e.g.  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(){

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

Who is Participating?
sjklein42Connect With a Mentor Commented:
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="" width=100% height=100% frameborder=0 scrolling=auto></iframe></body></html>

Open in new window

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

rgbcofAuthor Commented:
It turns out the an iframe is the best solution.  The url never divulge any path below  it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.