New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NUXT redirect before html rendering #2287

adnanmokhtar opened this Issue Nov 30, 2017 · 4 comments


None yet
3 participants
Copy link

adnanmokhtar commented Nov 30, 2017

i want to redirect to another domain if user comes from mobile when i type the url in browser before any html rendering.

but some html header and footer appear before redirect happen

how to fix that

This question is available on Nuxt.js community (#c2002)

This comment has been minimized.

Copy link

InstanceOfMichael commented Nov 30, 2017

You should be able to come up with a solution after reading these. There's multiple ways to address this, such in a component, in the vue-router, or in a middleware.
#112 (comment)

Another option is to check in the root component's beforeMount function and redirect using:

if (!isMobile && window.location.origin === "") {
    window.location = "";

This comment has been minimized.

Copy link

adnanmokhtar commented Nov 30, 2017

it work fine if i use navigation the redirect happen before rendering

but if i refresh the page or enter from url the redirect happen after some of html appear in the page


This comment has been minimized.

Copy link

clarkdo commented Dec 11, 2017

redirect wii support external link in both server and client side in next release.

@clarkdo clarkdo referenced this issue Dec 11, 2017


feat: allow redirect to external url #2265

3 of 3 tasks complete

@clarkdo clarkdo closed this Dec 11, 2017


This comment has been minimized.

Copy link

lock bot commented Nov 2, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 2, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.