I want to redirect my website to
my code so far in js is
When I save and deploy successfully and the indicator is published in Netlify I try going on my website again and it has shows the homepage and I want a few minutes and go grab a snack, I come back and it is still not redirected. What is the problem?
I have also tired
window.location = "https://uprightcode.com/comming-soon";
Video to see https://vimeo.com/559126337
Hi @Codeman, I don’t see an immediate issue with your code… do you have a link to the page to come?
BTW note that the equivalent to using the assignment operator would be, well,
location.assign() – with
location.replace() the current page will not be saved in the browser history, which may or may not be desired.
A link to the page containing your code, i.e. that should redirect to the “coming soon” page.
It is probably a problem with other files of code the redirect works perfectly on codepen as you can see here.
EDIT (or an extra thing)
My Code Up There: RIP:2021-2021 LAst Words - “I am Not responsive”
The reason I’m asking is that we we need to inspect the code in its context – there’s nothing wrong with it per se:
Yup, that’s exactly what I was getting at.
Your entire page should be like…
the other ones are for stuff. Duh
Then configure a proper server-side redirect… I have no experience with netlify myself but it seems to be easy enough:
Hmm, that is pretty awkward though. I do not see anything wrong with your code. Have you fixed it already?! What was wrong?
The post above yours answers these question!