Skip to content
Advertisement

How to redirect to home page

How can I redirect a user to home page?

Example: mywebsite.example/ddfdf/fdfdsf and I want to redirect to mywebsite.example

However I want to do it without typing the static name. How can I do this?

Advertisement

Answer

document.location.href="/";
Advertisement