301 Redirect to non-Wix Site

I need to redirect some pages of my Wix site to an external non-Wix site. I need to do 301 redirects for the SEO on the other site.

I have a router set up, but I’m not sure how to make this code work. Where do I put this code? The actual page, the router page, or the backend JS?

What else do I need to set up for this to work?

I would really appreciate the help!

import {redirect} from 'wix-router'

export function myRouter_Router(request) {

  return redirect("http://myothersite.com", "301");
}

@afowler: WIX does not support this, this is so pain :frowning:

Ever get this figured out? I am looking for a solution as well.

Hello maybe you have a solution in the meantime?
Thanks in advance!

Hello maybe you have a solution in the meantime?
Thanks in advance!

1 Like

Hello maybe you have a solution in the meantime?
Thanks in advance!

You don’t need router. Please see: Setting Up a 301 Redirect for a Page on Your Site | Help Center | Wix.com