Html – Redirect a wix website page to external URL

html

I'm trying to create a wix page which will redirect all users that link to it to an external URL.

I tried adding the code below as a "html wix app" but it didn't worked.

<meta http-equiv="refresh" content="0; URL=http://www.my-new-url.com">

Best Solution

I had a similar use case and solved it using the wix-location module:

import wixLocation from 'wix-location'; 

$w.onReady(function () {
     wixLocation.to("http://www.my-new-url.com");
})