#window.location.replace not redirecting to correct path?
6 messages · Page 1 of 1 (latest)
Use forward slashes not back slashes. Only Windows file paths use back slashes. Web URLs and Unix file paths all use forward slashes even if referencing a file on a Windows system.
If you want a URL to be relative to the current page do not start the URL with a slash. If you want it to be relative to the domain start it with a slash.
So when you're at example.com/hello
some/page would go to example.com/hello/some/page
/some/page would go to example.com/some/page (notice hello isn't in the URL now)
I do not think JavaScript will honor .. in a URL btw. I'm not 100% but I think that's the case.
Thank you very much 😄
I've got it working
it does seem as if .. does still work
what's strange is that I'd been using backslashes so far in other links in my code