0

I want to redirect from this page:

http://mywebpage/hotel/suite/availability/default.html

to:

http://mywebpage/hotel/suite/costs/default.html

I am using this to redirect:

window.location.href = "../../costs/default.html"

I need it to be a relative path, but I cant figure how to

  • 1
    That's already a relative path. But is only one level away, not 2, just remove one `../` – Triby Mar 23 '20 at 22:54
  • Does this answer your question? [Redirecting to a relative URL in JavaScript](https://stackoverflow.com/questions/1655065/redirecting-to-a-relative-url-in-javascript) – A. Meshu Mar 23 '20 at 22:54
  • @Triby that one is for one or domain path, but i need it to be for 2 levels up, is there a way to do that? –  Mar 23 '20 at 22:57
  • 1
    @Beastbeast Have you evaluated Triby's suggestion? It matches your example, so maybe your example is wrong. – Robert Mar 23 '20 at 23:08

1 Answers1

0

window.location.href = "../../costs/default.html"

Is working, apparently it was an error on the server wich didnt allow the app to refresh that line