views:

577

answers:

5

How do I mask the address of another site using HTML?

For example, I'd like:

http://www.example.com/source.html

To point to another page:

http://www.example.com/dest.html

Note that the destination page could be on another domain.

+2  A: 

There's plenty of people who would assert that your objective is to mislead the user, that it is unethical. However, if you really must do this, can you leave the link alone and redirect when the user arrives at the linked page?

DOK
A: 

If you are using Apache, you can use REWRITE mod, but it must be in the same domain. In .NET there rewrite libraries done. People will see in the address bar: source.html but the code will be that of dest.html.

Any other thing is simple redirects.

netadictos
A: 

You could do this with javascript. Just stick this on your page and it will redirect:

<script>location.href = 'http://www.example.com/dest.htm'&lt;/script&gt;
Dar
A: 

One way to do this is with an invisible frame set to 100% of the browser height. But what happens when someone clicks on a link in that framed page? I agree with DOK, people will be suspicious of your motives for doing this.

AmbroseChapel
A: 

A frameset seems to be what I was looking for:

<frameset rows="100%">
    <frame src="http://www.example.com/dest.html"/&gt;
</frameset>
ONODEVO