将wix网站页面重定向到外部URL

ASM*_*ASM 6 html

我正在尝试创建一个wix页面,它将链接到它的所有用户重定向到外部URL.

我尝试将下面的代码添加为"html wix app",但它没有用.

<meta http-equiv="refresh" content="0; URL=http://www.my-new-url.com">
Run Code Online (Sandbox Code Playgroud)

小智 7

我有一个类似的用例,并使用wix-location模块解决了它:

import wixLocation from 'wix-location'; 

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

  • 太好了,这很好用。它基于 wixcode API。如何使用它:打开您正在编辑的页面。单击代码面板并粘贴代码。就像这样并发布它。一切都按预期工作。 (2认同)

Pri*_*nce 1

也许尝试:

<meta http-equiv="refresh" content="0; URL=http://www.my-new-url.com/" />
Run Code Online (Sandbox Code Playgroud)

您在最后遗漏了一个“。我希望这会有所帮助!

尝试:

<script type="text/javascript">
    window.location.href = "http://www.my-new-url.com"
</script>
Run Code Online (Sandbox Code Playgroud)

尝试这个:

<html>
<meta http-equiv="refresh" content="0; URL=http://www.my-new-url.com/" />
</html>
Run Code Online (Sandbox Code Playgroud)