My app (bluedapp) redirects to yourotherdomain.com (a non-existent site)

#1

It all started one day when I was browsing sites looking for ways to use Express to redirect to other websites (or files). I copied a snippet of code.

res.redirect(301, 'http://yourotherdomain.com');

I changed the code to redirect to the 404 page of my app whenever a file couldn’t be found, and I ran the refresh command in console. I pressed Show Live. It redirected to yourotherdomain.com. I refreshed it again, and again, but to no avail.

My app is called bluedapp, it’s supposed to be an Ethereum DApp making platform (You fill in some fields, then it generates something with its magic for you to deploy)

#2

Hey @TrueCodeFusionX, this is a frustrating bug! The line of code you used sent an HTTP 301 status code which means, “redirect permanently”. This means in the future the computer will remember that and not even try to reach your website! The best way to fix this is to clear your browser’s cache, so it will forget the 301 response. In addition, I recommend using the code 302 for the redirect, which is a “Temporarily Moved” response, so if you change your mind, you won’t have to clear things again.

Hope that helps!

#3

Thank you for the help! I’ll clear my browser cache now!