#How to redirect to another website?

12 messages · Page 1 of 1 (latest)

hollow tusk
#

I got a third party url I need to redirect to from my server component. Ideally, I would like this to work without javascript enabled. Using redirect from next/navigation seems to throw an error. What are the alternatives?

Thanks

crimson wingBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

iron wave
hollow tusk
#

The next.config is a permanent redirect to a hardcoded URL, mine is dynamic.
The other solution requires javascript, ideally I want a solution that works with javascript disabled

golden plinth
#

Ok so @hollow tusk

#

I remember the nextjs team mentioning that router.push might work with js disabled (yes I know it needs a client components.. black magic what can you say)

#

Now I'm not sure

#

So give it a try

#

What's the error you get btw using redirect for an external url.. since redirect should just work default with an absolute url

hollow tusk
#

I'll check it out, I forgot the error and moved on. I can update the thread tomorrow to get more data

#

Thanks!

barren bough