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
3
Medium Priority
?
328 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 1000 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

722 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