1

I want to change the page URL without changing the Page with Javascript, I want to completely change the URL including the Host Domain.

For example: Origional URL: http://host-one.com/page.html  
             New URL      : http://host-two.com/another-page.html

But not changing the contents.

Thanks in advance for the help !

VirMatrix
  • 51
  • 6

2 Answers2

2

Simply: you can't.

The way that some sites (most notably Facebook) do it is to use anchors in the URL

EDIT

It seems you can in Chrome, Safari, FF4+, and IE10pp4+:

Modify the URL without reloading the page

Community
  • 1
  • 1
ChrisW
  • 4,970
  • 7
  • 55
  • 92
  • actually, no you can't. The HTML5 method posted in the question you linked to only allows you to change the _path_ component of the URL, not the domain part. – Alnitak May 28 '12 at 12:21
1

No, you can't do this.

HTML5's history.pushState() allows you to change the path of the current URL, but not the domain.

Alnitak
  • 334,560
  • 70
  • 407
  • 495